President Donald Trump has vetoed a resolution passed by Congress to end US military assistance in Saudi Arabia’s war in Yemen.

The veto — the second in Mr Trump’s presidency — was expected, and Congress lacks the votes to override it.

But passing the never-before-used war powers resolution was viewed as a milestone for lawmakers.

“This resolution is an unnecessary, dangerous attempt to weaken my constitutional authorities, endangering the lives of American citizens and brave service members, both today and in the future,” Mr Trump wrote in explaining his veto.

Congress has grown uneasy with Mr Trump’s close relationship with Saudi Arabia as he tries to further isolate Iran, a regional rival.

This resolution is an unnecessary, dangerous attempt to weaken my constitutional authorities

Donald Trump

Many lawmakers also criticised the president for not condemning Saudi Arabia for the killing of Jamal Khashoggi, a Saudi who lived in the United States and had written critically about the kingdom.

Mr Khashoggi went into the Saudi consulate in Istanbul last October and never came out. Intelligence agencies said Saudi Crown Prince Mohammed bin Salman was complicit in the killing.

The US provides billions of dollars of arms to the Saudi-led coalition fighting against Iran-backed rebels in Yemen.

Members of Congress have expressed concern about the thousands of civilians killed in coalition air strikes since the conflict began in 2014.

The fighting in the Arab world’s poorest country also has left millions suffering from food and medical care shortages and has pushed the country to the brink of famine.

Mr Trump said the measure was unnecessary because except for counterterrorism operations against Islamic State militants and al Qaida in the Arabian Peninsula, the United States is not engaged in hostilities in or affecting Yemen.

He said there were no US military personnel in Yemen accompanying the Saudi-led coalition fighting Iran-backed Houthis, although he acknowledged that the US has provided limited support to the coalition, including intelligence sharing, logistics support, and — until recently — in-flight refuelling of non-US aircraft.

The president also said that the measure would harm bilateral relations and interferes with his constitutional power as commander in chief.

He said the US is providing the support to protect the safety of more than 80,000 Americans who live in certain areas of the coalition countries subject to Houthi attacks from Yemen.

“Houthis, supported by Iran, have used missiles, armed drones and explosive boats to attack civilian and military targets in those coalition countries, including areas frequented by American citizens, such as the airport in Riyadh, Saudi Arabia,” Mr Trump said.

“In addition, the conflict in Yemen represents a ‘cheap’ and inexpensive way for Iran to cause trouble for the United States and for our ally, Saudi Arabia.”

House approval of the resolution came earlier this month on a 247-175 vote. The Senate vote last month was 54-46.

Democratic Representative Eliot Engel, chairman of the House Foreign Affairs Committee, voted to end US military assistance to the war, saying the humanitarian crisis in Yemen triggered “demands moral leadership”.

The top Republican on the committee, Representative Michael McCaul, acknowledged the dire situation in Yemen for civilians, but spoke out in opposition to the measure when it was passed.

Mr McCaul said it was an abuse of the War Powers Resolution and predicted it could disrupt US security cooperation agreements with more than 100 countries.

Mr Trump issued his first veto last month on legislation related to immigration.

Mr Trump had declared a national emergency so he could use more money to construct a border wall. Congress voted to block the emergency declaration and Mr Trump vetoed that measure.