WASHINGTON — President Donald Trump on Wednesday vetoed a bill to end U.S. military assistance in Saudi Arabia's war in Yemen.

In a break with the president, Congress voted for the first time earlier this month to invoke the War Powers Resolution to try to stop U.S. involvement in a foreign conflict.

The veto — the second in Trump's presidency — had been expected. Congress lacks the votes to override him.

"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," Trump wrote in explaining his veto.

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

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

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

The United States provides billions of dollars of arms to the Saudi-led coalition fighting Iran-backed rebels in Yemen. Members of Congress have expressed concern about the thousands of civilians killed in coalition airstrikes 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.

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

Rep. Eliot Engel, D-N.Y., chairman of the Foreign Affairs Committee, voted to end U.S. military assistance to the war, saying the humanitarian crisis had triggered "demands moral leadership."

The top Republican on the committee, Michael McCaul of Texas, acknowledged the dire situation for civilians but spoke out against the bill. McCaul said it was an abuse of the War Powers Resolution and said it could disrupt U.S. security cooperation agreements with more than 100 countries.