LONDON — British lawmakers voted Monday to replace the country’s aging fleet of nuclear-armed submarines with new vessels, heeding Prime Minister Theresa May’s warning that relinquishing atomic weapons would be a “reckless gamble.”

May’s Conservative government is committed to keeping the country’s nuclear arsenal, a powerful but costly symbol of the country’s military status that consists of four Royal Navy submarines armed with Trident missiles.

After six hours of debate, lawmakers in the House of Commons voted 472 to 117 to build new submarines to replace the current fleet, in service since the 1990s. The government estimates the cost of the new subs at up to $54 billion over 20 years.

Although the result was lopsided, the debate stirred strong emotions – and split the opposition Labour Party.

In her first House of Commons session since taking office last week, May didn’t hesitate when an opposition lawmaker asked the toughest question for any leader of a nuclear state: Would she be willing to order a nuclear strike?

“Yes,” May said.

May said “the nuclear threat has not gone away; if anything, it has increased” with a newly assertive Russia and a desire from countries including North Korea to acquire nuclear weapons in defiance of the international community.

May said that although Britain has voted to leave the European Union, “we will not leave our NATO and European allies behind.”

“We cannot outsource the grave responsibility we shoulder for keeping our people safe,” she said, adding that scrapping the weapons would be “a reckless gamble, a gamble that would enfeeble our allies and embolden our enemies.”

Britain has been a nuclear power since the 1950s, and both Labour and Conservative governments have consistently supported atomic weapons.

May’s Conservatives made replacing the four submarines – Vanguard, Victorious, Vigilant and Vengeance – with four new ones a promise in last year’s election.

The Scottish National Party, which holds 54 of the 650 House of Commons seats, is firmly opposed to renewing the Trident fleet, which is based on Scotland’s west coast.

The issue divides the largest opposition party, Labour, which is in the midst of a battle over who will lead it. The schism between pro- and anti-nuclear forces has long been a fault-line in the Labour Party.