The chairman of the board at Gazprom is the Russian deputy prime minister, Dmitry Medvedev, and the chairman of Rosneft is Igor Sechin, deputy head of the presidential administration.
Gazprom and Rosneft have engaged in fierce competition for energy projects, seen as reflecting a battle for power between Kremlin factions, and a proposal to merge the two was scrapped last year.
The main aim of the partnership agreement announced on Tuesday was to avoid "confrontation" between Gazprom and Rosneft, said Andrei Gromadin, an oil and gas analyst at MDM bank.
Gromadin said the state did not want the two giants to "compete anymore both on the external and internal market", and the agreement could encourage "joint foreign purchases" by lowering operational risks.
The deal, signed by Gazprom chief executive officer Alexei Miller and Rosneft CEO Sergei Bogdanchikov, would remain in place until 2015, after which it could be renewed in five-year periods.
The company has been at the centre of confrontations between Moscow and former Soviet states over energy supplies.
Russia has been accused of using Gazprom as a political weapon to threaten its neighbours.
Earlier this month, Gazprom said it would double the price of gas supplies to Georgia from 2007.
And in January, Russia cut off gas supplies to Ukraine in a row of the price of gas.