Addressing a summit of the six-nation Gulf Cooperation Council in Bahrain, May reaffirmed British support for traditional allies in the region, while also seeking to strengthen post-Brexit trade.
"I want to assure you that I am clear-eyed about the threat that Iran poses to the Gulf and to the wider Middle East," she told leaders of the GCC, which brings together Saudi Arabia, Bahrain, Kuwait, Oman, Qatar and the United Arab Emirates.
The mainly Sunni Arab Gulf monarchies and Shiite Iran are bitter regional rivals, at odds over a range of issues including the wars in Syria and Yemen.
The Iran agreement was "vitally important for regional security," May told the summit.
More From This Section
"But we must also work together to push back against Iran's aggressive regional actions."
In a joint statement after the summit, Britain and the GCC agreed to a "strategic partnership" that would foster "political, defence, security and trade" ties, while "developing collective approaches to regional issues".
In their statement, GCC states and Britain said they "oppose and will work together to counter Iran's destabilising activities".
The statement said Britain and GCC countries were "committed to continue working towards a sustainable political resolution in Syria", where President Bashar al-Assad "has lost all legitimacy and has no role in Syria's future."
It called for Assad's backers including Russia and Iran "to support a meaningful end to the violence, sustained humanitarian access and an inclusive political process" in Syria.
During her speech, May said the two sides would study liberalising trade as Britain prepares to leave the European Union after the shock referendum vote to quit the bloc.
May was the first woman and first British leader to address a GCC summit, as Gulf countries deepen ties with major powers beyond longtime ally the United States.
In May last year, France's President Francois Hollande became the first Western head of state to attend a GCC summit.
US President Barack Obama followed in April this year, seeking to reassure Gulf monarchs about US overtures to Iran.