LONDON — Britain’s main opposition leader on Friday accused Prime Minister Theresa May of pandering to an “erratic” U.S. administration, as defense and security took center-stage in the U.K. election campaign.

May was the first world leader to visit Donald Trump after his inauguration, and has stressed the importance of the trans-Atlantic “special relationship” to global security.

Labour Party leader Jeremy Corbyn said that “waiting to see which way the wind blows in Washington isn’t strong leadership. And pandering to an erratic administration will not deliver stability.”

He accused Trump of “recklessly escalating the confrontation with North Korea, unilaterally launching missile strikes on Syria, opposing President Obama’s nuclear arms deal with Iran and backing a new nuclear arms race.”

Corbyn, a longtime anti-war activist who opposed the invasions of Afghanistan and Iraq, used a speech at the international affairs think tank Chatham House to outline his vision for defense and foreign policy.

He said he supported military action “as a genuine last resort” but accused recent British and U.S. governments of “bomb first, talk later” policies.

Recent U.K. governments, both Conservative and Labour, have joined U.S.-led military interventions in Afghanistan, Iraq, Libya and against the Islamic State group in Syria.

Corbyn said he would take a different direction, calling the U.S.-led “war on terror” a failure.

“It has not increased our security at home. In fact, many would say, just the opposite,” he said.

Corbyn said that a Labour government would seek greater international cooperation to end the conflict in Syria and “work to halt the drift to confrontation with Russia … winding down tensions on the Russia-NATO border.”

May’s Conservatives see Corbyn’s opposition to military action and nuclear weapons as a major weakness to be exploited in campaigning for the June 8 election. The party’s main slogan is “strong and stable” — in contrast to what May calls “a Corbyn-led coalition of chaos.”

Corbyn’s desire to scrap the U.K.’s fleet of nuclear-armed submarines also puts him at odds with the official position of the Labour Party.

“Jeremy Corbyn is a guy who has campaigned all his life to weaken the U.K.’s defenses,” Foreign Secretary Boris Johnson said.