UPDATE 1-Canadian oil producer Encana posts quarterly profit

(Adds details, background)

July 21 (Reuters) - Canadian oil and gas producer Encana Corp on Friday posted a quarterly profit compared with a loss a year earlier, when it took impairment and hedging charges of about $641 million.

Encana has benefited from downsizing its operations to focus on four core North American assets: the Montney and Duvernay in western Canada, and the Eagle Ford and Permian in the United States.

Oil prices began to rise late last year after a two-year slump, now hovering around $50 per barrel, as an OPEC-led production cut and rebounding demand slowly erode a global glut.

The Calgary-based company posted net earnings of $331 million, or 34 cents per share, in the second quarter ended June 30, compared with a loss of $601 million, or 71 cents per share, a year earlier.

Operating earnings, which exclude most one-time items, doubled to $180 million in the quarter.

However, total oil and gas production fell to 316,000 barrels of oil equivalent per day (boe/d) from 368,300 boe/d a year earlier. (Reporting by Anirban Paul in Bengaluru; Editing by Martina D'Couto)