(Reuters) - Russian state oil major Rosneft has agreed to invest $400 million in five oil blocks in Iraqi Kurdistan, increasing Moscow's exposure to the semi-autonomous region despite a major spike in tensions with the central government in Baghdad.

Rosneft has previously loaned Kurdistan $1.2 billion guaranteed by oil sales and is seeking to help Erbil build two major oil and gas pipelines as part of President Vladimir Putin's drive to regain influence in the Middle East.

The region plunged into a major crisis last month when Kurdistan held an independence referendum, which was immediately denounced by Baghdad and neighbouring Iran and Turkey.

In the build up to the referendum, only Israel supported Kurdish independence drive while Moscow stayed silent on the referendum - in deep contrast with the United States and other Western powers which asked Erbil to scrap the vote.

Iraq, Iran and Turkey blocked Erbil's air traffic and banking communications and on Tuesday Iraqi forces retook major fields back from the Kurdish Peshmerga forces, thus effectively halving oil production under direct control of Erbil.

Despite quickly changing events in Kurdistan, Rosneft on Wednesday said it had signed a deal with the government of Kurdistan to put into force production sharing agreements on five production blocks in the region.

It said it would hold 80 percent in the PSA and pay for the projects farm-in and geological information between $40-$110 million per block or a total of $400 million including $200 million that can be compensated by oil produced from the block.

The parties agreed to implement the geological exploration programme and to start pilot production as early as in 2018 and full-field development by 2021. Rosneft said the total recoverable oil reserves at five blocks may amount to 670 million barrels.