"I congratulate my former counterpart, @BorisJohnson on becoming UK PM," Mohammad Javad Zarif tweeted amid a standoff between the two countries over the seizure of oil tankers.
"Iran does not seek confrontation. But we have 1500 miles of Persian Gulf coastline. These are our waters & we will protect them," Iran's top diplomat wrote.
Amid rising hostilities with the United States, Iran's Revolutionary Guards on Friday seized a tanker sailing under the flag of US ally Britain.
The seizure of the Swedish-owned vessel has been seen as a tit-for-tat move after British authorities detained an Iranian tanker on July 4 in the Mediterranean on suspicion it was shipping oil to Syria in breach of EU sanctions.
In a video message posted along with Tuesday's tweet, Zarif warned Britain against engaging "in implementing the ploys of the B team".
Zarif uses the term "B team" to refer to US national security adviser John Bolton, Israeli Prime Minister Benjamin Netanyahu, and Saudi and Abu Dhabi crown princes Mohammed bin Salman and Mohammed bin Zayed, who are all pushing a hard line on Iran.
"We are responsible for the security and the freedom of navigation in the Persian Gulf, that is our lifeline," he tweeted.
"The B Team is losing ground in the United States and now they are turning their attention to the United Kingdom. I guess the same policies that failed in the US will fail the United Kingdom."