Washington is expected to announce by the end of this week, whether the United States will remain part of the deal.
"Of all the options we have for ensuring that Iran never gets a nuclear weapon, this pact offers the fewest disadvantages. It has weaknesses, certainly, but I am convinced they can be remedied," Johnson said in his article for the New York Times newspaper, published on Sunday.
The UK foreign secretary added that he saw "no possible advantage in casting them [the limits placed on Iran] aside."
"Only Iran would gain from abandoning the restrictions on its nuclear program," Johnson said.
"I believe we are very close to a position that would address President Trump’s concerns and strengthen trans-Atlantic unity. At this delicate juncture, it would be a mistake to walk away from the nuclear agreement and remove the restraints that it places on Iran," the UK foreign secretary said.
In 2015, Iran, China, France, Germany, Russia, United Kingdom, United States, and the European Union agreed on the Joint Comprehensive Plan of Action, or simply the nuclear deal, under which the international sanctions would gradually be lifted off Iran in exchange for Tehran maintaining the peaceful nature of its nuclear program. Trump has been critical of the deal since his election campaign, saying the European Union needed to fix major flaws in it.