(Adds comments on curtailment, rail movement; share activity)
By Rod Nickel and Taru Jain
Feb 12 (Reuters) - Canadian oil producer Cenovus Energy posted a surprise fourth-quarter loss on Wednesday, due in part to higher-than-expected royalty costs and weaker refining margins.
Shares of the company fell 2.9% to C$11.63 in Toronto.
The company produced 467,448 barrels of oil equivalent per day (boe/d) during the quarter, an increase of 8% from a year-ago period when it had restrained production rates. Cenovus took advantage of the Alberta government's special production allowance, which permits additional oil output if it moves by rail.
The province has for more than a year limited production to manage a surplus of oil to flow through congested pipelines.
The loss also reflected weaker refining margins as those curtailments propped up prices of Canadian heavy crude, although analysts said the weaker margins were expected.
Reduced refining margins show the ripple effects of Alberta's drastic efforts to address the Canadian industry's struggles.
"A market imbalance still exists and production curtailment is still necessary," Chief Executive Alex Pourbaix said on a quarterly call with analysts.
Cenovus' refining and marketing operating margin more than halved to C$109 million for the quarter. Royalty costs were higher than expected, National Bank Financial analyst Travis Wood said.
Cenovus, which had earlier expected crude-by-rail volume to ramp up to about 100,000 barrels per day (bpd) by the end of 2019, said it achieved volume of 106,000 bpd in December.
The Alberta government said on Tuesday that it was finalizing the sale of its crude by rail contracts to the private sector. Pourbaix said the company took "a hard look," but decided it was comfortable with its existing rail program.
Protests in parts of Canada, linked to indigenous concerns about construction of the Coastal GasLink pipeline, have targeted rail lines and ports.
"Blockades could potentially jeopardize some movements across Canada," said Keith Chiasson, executive vice president of downstream.
Net earnings from continuing operations were C$113 million ($85.15 million), or 9 Canadian cents per share, in the fourth quarter, compared with a loss of C$1.35 billion, or C$1.10 per share, a year earlier.
Excluding items, Cenovus posted a loss of 13 Canadian cents per share. Analysts on average had expected a profit of 11 Canadian cents per share, according to IBES data from Refinitiv.
$1 = 1.3270 Canadian dollars Reporting by Taru Jain and Rod Nickel in Winnipeg; Editing by Krishna Chandra Eluri and Tom Brown