BEIJING (Reuters) - China announced a surprise increase of about 18 percent in retail gasoline and diesel prices effective from Friday, state media said.

It will be the first rise in fuel prices in eight months, a move that threatens to stoke already decade-high inflation.

Prices for gasoline and diesel prices will rise by 1,000 yuan ($145.5) per tonne each.

Oil prices fell $3 a barrel on Thursday on the news on worries that demand from the world’s second-largest oil consumer would be hit. China has been one of the main factors driving oil prices to a record near $140.

China last raised pump fuel prices in November.

The move in November took many market watchers by surprise as Beijing has repeatedly vowed to rule out “near-term” price increases to battle high inflation and avoid social unrest barely two months away from the Beijing Olympics.

China also raised jet fuel prices by 1,500 yuan per tonne.

The official Xinhua news agency reported that China will also raise some electricity tariffs from July 1.

The average electricity tariff would go up by 0.025 yuan/kwh, though exemptions will be granted to urban and rural residents along with some farmers and fertilizer producers, the report said, citing the National Development and Reform Commission.

“Global crude prices have been rising sharply and Chinese domestic fuel prices have lagged behind. The price difference has highlighted the contradiction between demand and supply,” said state television, also quoting the National Development and Reform Commission.

(Reporting by Carolyn Qu and Chen Aizhu; editing by James Jukwey)