The House late Thursday night overwhelmingly approved $300 million in new aid to Ukraine.

The 311-117 vote came after House GOP leaders on Wednesday stripped the Ukraine assistance from a Pentagon funding bill. All “no” votes came from Republicans.

Though it drew broad support, the funding has been a source of controversy for the past week.

The $300 million was initially included in legislation funding the Department of Defense for fiscal 2024, which drew opposition from hard-line Republicans.

Speaker Kevin McCarthy (R-Calif.) told reporters last week that he would remove the $300 million from the defense bill and hold a separate vote on the funding after Rep. Marjorie Taylor Greene (R-Ga.) joined a band of conservatives in sinking a procedural vote to advance the Pentagon measure.

But the Speaker backtracked one day later, announcing he would not separate the Ukraine aid from the defense bill after realizing the appropriations measure to fund the State Department also included assistance for Kyiv. He said it would be “too difficult” to remove the Ukraine aid from the State Department legislation, and would ultimately leave both as they were.

The House went ahead and adopted a combined rule — which governs debate on legislation — for the two measures and two other appropriations bills. Greene was the lone “no” vote.

An amendment sponsored by Rep. Andy Biggs (R-Ariz.) that would strip the $300 million from the legislation was voted down Wednesday in a 330-104 vote, with all support coming from Republicans.

House Republicans also soundly rejected an amendment from Rep. Matt Gaetz (R-Fla.) to prohibit security assistance for Ukraine in a 339-93 vote.

But late Wednesday night, amid uncertainty over whether the legislation had enough support to pass, the House Rules Committee convened a last-minute hearing to strip the $300 billion from the Pentagon bill and hold a separate vote on the funding.

Support for Ukraine in its battle against Russia has become a hot-button issue in the House Republican conference, with some lawmakers pushing to curtail assistance for Kyiv and others saying the U.S. must support its embattled ally.

Ukrainian President Volodymyr Zelensky visited the Capitol and met with lawmakers last week. McCarthy told reporters Zelensky asked to address a joint session, but he declined because “we just didn’t have time.”