MOSCOW — A former cabinet minister in Russia accused of accepting a $2 million bribe went on trial in Moscow on Wednesday, the highest-ranking official to be prosecuted in the country in decades.

The former minister, Aleksei V. Ulyukayev, 61, was in charge of economic development from June 2013 to November 2016, when he was arrested on corruption charges linked to the sale of an oil company.

The government has portrayed the case as an example of successful anticorruption efforts in Russia. Mr. Ulyukayev is accused of soliciting more than $2 million from Igor I. Sechin, the chief executive of the state oil giant Rosneft, in exchange for endorsing the company’s purchase in 2016 of a stake in Bashneft, a smaller oil firm that had been nationalized in 2014. Mr. Ulyukayev, a critic of the growing role of the state in the Russian economy, was the most prominent government official to object to the acquisition.

The defendant and many analysts say the extraordinary case involves one of President Vladimir V. Putin’s closest allies trying to settle scores.