Their competition for influence has become more visible as Iran's economic problems deepen, but their shared interest in containing more hardline factions has kept their relationship from turning into open confrontation.
Even before the war, the late Supreme Leader Ali Khamenei had twice urged rival political camps to avoid public disagreements that could benefit Iran's enemies.
What has changed is the political cost of cooperation. As economic conditions deteriorate, Ghalibaf has stronger incentives to distance himself from the government's failures, while Pezeshkian needs parliament's support to pursue his economic and diplomatic agenda.
Cooperation under pressure
Ghalibaf defended parliament's cooperation with Pezeshkian at a press conference this week, saying lawmakers should help the government rather than look for opportunities to undermine it.
Yet he also stressed that cooperation did not mean abandoning parliamentary oversight. He pointed to ministerial impeachments and confirmed that at least one more was on the agenda.
Ghalibaf also acknowledged that economic mismanagement and structural weaknesses, rather than war and American pressure alone, were contributing to rising prices.
His position reflects a political calculation: supporting the government when national security is at stake while making clear that parliament will not accept responsibility for every unpopular economic decision.
Ghalibaf has little reason to shield the administration from all criticism. But he also has little to gain from a political crisis that could strengthen his own opponents.
A rivalry dating back to 2024
The two men's political competition predates Pezeshkian's presidency.
Both ran in the 2024 presidential election. Ghalibaf was eliminated in the first round, while Pezeshkian went on to defeat ultraconservative candidate Saeed Jalili in the runoff.
Ghalibaf could seek the presidency again. That gives him an incentive to maintain a political identity separate from the administration, particularly when it comes to unpopular economic measures such as fuel price increases.
The danger for him is becoming associated with policies over which he has limited direct control. The danger for Pezeshkian is facing a parliament whose speaker can cooperate with the government on one issue while allowing pressure to build against it on another.
Diplomacy and competing ambitions
Both Pezeshkian and Ghalibaf have faced criticism from hardline factions for appearing too willing to engage with Washington. The newspaper Kayhan, among others, has attacked signs of flexibility toward the United States.
Foreign Minister Abbas Araghchi has said Pezeshkian personally supported giving Ghalibaf a prominent role in talks with Washington.
That suggests the president recognizes the political value of involving a rival whose conservative credentials and institutional position could help build support for negotiations.
For Ghalibaf, a prominent role in diplomacy would also strengthen his position as a national political leader and give him influence over decisions that could shape Iran's future.
The two therefore have reasons to cooperate even when their longer-term ambitions diverge.
The hardliners' dilemma
The most important factor shaping their relationship may be the pressure both face from more radical factions.
The Paydari Front and other ultraconservative groups have repeatedly challenged Pezeshkian's government, particularly over economic policy and engagement with the United States. But Ghalibaf, a pragmatic conservative, has also been a target of their criticism.
Their opposition to both men helps explain why political competition between the president and parliament speaker has not developed into an outright institutional confrontation.
Ghalibaf reportedly opposed efforts by hardliners to remove Pezeshkian from office in recent months.
The approaching budget debate may test the limits of their cooperation.
Their relationship is neither a stable alliance nor a straightforward rivalry. It is a contest over influence conducted within a framework of mutual political dependence.
The question is whether worsening economic conditions will eventually make that balance impossible to sustain, or whether the threat from their common opponents will continue to give both men a reason to work together.