Heading into the meeting, the signs were not good. Oil markets went into reverse. Saudi Prince Mohammed had repeatedly demanded Iran participate in supply cuts. Saudi and Iranian OPEC negotiators had argued in circles in the run-up to the meeting.
And, then, just a few days beforehand, Riyadh appeared back away from a deal, threatening to boost production if Iran failed to contribute cuts.
But Putin established that the Saudis would shoulder the lion's share of cuts, as long as Riyadh wasn't seen to be making too large a concession to Iran.
A deal was possible if Iran didn't celebrate victory over the Saudis.
A phone call between Putin and Iranian President Rouhani smoothed the way.
After the call, Rouhani and oil minister Bijan Zanganeh went to their supreme leader for approval, a source close to the Ayatollah said.
"During the meeting, the leader Khamenei underlined the importance of sticking to Iran's red line, which was not yielding to political pressures and not to accept any cut in Vienna," the source said.
"Zanganeh thoroughly explained his strategy ... and got the leader's approval. Also it was agreed that political lobbying was important, especially with Mr. Putin, and again the Leader approved it," said the source.
On Wednesday, the Saudis agreed to cut production heavily, taking "a big hit" in the words of energy minister Khalid al-Falih - while Iran was allowed to slightly boost output.
Iran's Zanganeh kept a low profile during the meeting, OPEC delegates said.
Zanganeh had already agreed the deal the night before, with Algeria helping mediate, and he was careful not to make a fuss about it.
After the meeting, the usually combative Zanganeh avoided any comment that might be read as claiming victory over Riyadh.
"We were firm," he told state television. "The call between Rouhani and Putin played a major role ... After the call, Russia backed the cut."