US Secretary of State John Kerry has said he is still confident of a nuclear deal with Iran after President Barack Obama agreed to sign legislation giving Congress the right to reject an agreement.

A Sajjil missile is displayed by Iran's Revolutionary Guard, in front of a portrait of the Iranian supreme leader Ayatollah Ali Khamenei

A Sajjil missile is displayed by Iran’s Revolutionary Guard, in front of a portrait of the Iranian supreme leader Ayatollah Ali Khamenei

Mr Kerry joined his counterparts from the G7 at a meeting in northern Germany on the gathering’s second day, flying in overnight after discussing Iran in Washington.

“Yesterday there was a compromise reached in Washington regarding congressional input,” he told reporters in Lubeck. “We are confident about our ability for the president to negotiate an agreement, and to do so with the ability to make the world safer.”

Mr Kerry said the challenge of finishing the negotiations with Iran over the next two-and-a-half months would loom large over the G7 meeting.

Its host, German foreign minister Frank-Walter Steinmeier, said ministers would discuss the deal between the US administration and Congress, which he said would have “a certain influence” on whether a deal with Iran can be achieved by a June 30 deadline.

Mr Steinmeier said other topics would include conflicts in the Middle East, prospects for peace talks between Israel and the Palestinians, efforts to combat the Islamic State group, the Ebola outbreak in West Africa, the impact of climate change on political stability in Africa and Asia, and the ongoing fighting in Ukraine.

“The weather in international politics is quite stormy,” he said. “The conflict in eastern Ukraine is only two hours away from here.”

Mr Steinmeier said the G7’s top diplomats would also issue a statement on maritime security, noting that Lubeck was plagued by pirates until the Hanseatic League – an alliance of northern European trading cities – cracked down on the practice some 600 years ago.

Although Russia was ejected from what was then the G8 last year over its support for armed separatists in eastern Ukraine, Mr Steinmeier praised Moscow for what he called its “constructive attitude” in not blocking a UN Security Council resolution imposing an arms embargo on Houthi rebel leaders in Yemen.