By a large margin, the U.S. Senate approved additional funding to train and arm moderate Syrian rebels Thursday. President Barack Obama announced that the legislation passed with a majority of both Democratic and Republican leaders in the House of Representatives and the U.S. Senate. The measure -- inserted in a larger Senate funding bill aimed at avoiding another government shutdown -- now goes to President Obama to sign into law. 

The United States is “strongest as a nation when the president and Congress work together,” Obama said Thursday in a speech from the White House.

The vote in the Senate was 78-22 in support of funding, Reuters reported. The Senate debate came a day after the House of Representatives passed the measure in a 273-156 vote. But many pols (especially those with presidential ambitions) made it clear that their support for this piece of legislation doesn't translate into backing for Obama's strategy in the Mideast.

Obama called on Congress to approve the legislation last week when he announced his four-point strategy to target the Islamic State “wherever they exist.” Obama said Thursday that the U.S. would lead a coalition against the militants formerly known as the Islamic State of Iraq and Syria (ISIS) or ISIL of “more than 40 countries, including Arab nations.”

Aside from the additional money for Syrian rebels, the legislation will keep the government funded after Oct. 1, preventing what would have been the second shutdown in Obama's presidency. The previous one, driven by the GOP's opposition to the Affordable Care Act, damaged Republicans politically (although they have recovered and Obama's standing has weakened). 

The vote came at a critical time in U.S. politics with the midterm elections closing in and the 2016 presidential campaign already starting to take shape. Several Republican legislators used the vote as a chance to stake out positions on ISIS and also highlight their disagreements with Obama.  

U.S. Sen. Ted Cruz (R-Texas)

Ted Cruz Senator Ted Cruz (R-TX) delivers remarks at the Faith & Freedom Coalition "Road to Majority" policy conference in Washington, June 19, 2014. Photo: REUTERS/Yuri Gripas Sen. Ted Cruz said he wouldn't support the legislation because it didn't address domestic issues like immigration and Obamacare,.

“This is a moment of choosing for every senator where history will record you stood in face of the president’s promise to unlawfully modify immigration law in America?” Cruz asked the Senate. “I predict most if not all Senate Democrats will vote in favor of President Obama’s amnesty. And I have a lot higher opinion of the American people, of the voters than it seems the president does. I think the American people understand what’s going on.” 

U.S. Sen. Marco Rubio (R-Florida)

Marco Rubio U.S. Senator Marco Rubio (R-FL) is interviewed at the Reuters Health Summit 2014 in Washington April 1, 2014. Photo: Reuters

Sen. Marco Rubio made it clear Thursday that he didn't agree with Obama’s foreign policy choices yet said he would still vote in favor of the legislation. Rubio, a possible 2016 presidential candidate, may have wanted to be on the record backing a strong military response to the militants, the New York Times reported

“Previous presidents had merely taken their foot off the gas pedal of American strength,” Rubio said in a speech to conservatives preceeding the debate. “But President Obama has stomped on the brake.”

U.S. Sen. Rand Paul (R-Kentucky)

Rand Paul U.S. Senator Rand Paul (R-KY) speaks during the second day of the 5th annual Faith & Freedom Coalition's "Road to Majority" Policy Conference in Washington, June 20, 2014. Photo: REUTERS/Larry Downing

Sen. Rand Paul, another possible presidential candidate, didn't vote in favor of Obama’s legislation. In a 45 minute speech, Paul opposed arming rebels, and he said the U.S. strategy against ISIS should be put in a separate legislation from funding the government.

“Let’s not compound the problem by arming feckless rebels in Syria who seem to be merely a pit stop for weapons that are really on their way to ISIS,” he said.

“Where I differ with this administration is whether to arm the same side as the jihadists. There are bad people on both sides,” Paul said. “We need to stay the heck out of their civil war.”

He blamed past U.S. intervention for the current chaos, and said that Muslim moderates need to do more to combat the threat of terrorism in the region.

"Civilized Islam needs to crush radical Islam,” Paul said, according to Yahoo News. “The voices aren't loud enough. I don't want to see them sipping tea or at the discotheque in Cairo.”

U.S. Sen. Lindsey Graham (R- South Carolina)

US Senator Graham points as he addresses the gala banquet of the AIPAC annual policy conference in Washington US Senator Graham points as he addresses the gala banquet of the AIPAC annual policy conference in Washington Photo: Reuters

Sen. Lindsey Graham stressed that he didn't agree with the way Obama was combating the militants, yet agreed with the importance of taking military action, whatever it may be, as soon as possible.

“This is not the right process but we are where we are,” Graham said. “This is a military strategy, I believe, designed around political promises. This is not the military strategy you would create to destroy or devastate ISIL.”

Graham called out those who believed there were no moderate rebels on the ground the U.S. could trust.

“I don’t believe you quite understand what’s going on in Syria. I would say that the vast majority of Syrians have two things in common: They want to overthrow [Syrian President Bashar] Assad and they want to get ISIL out of their country.”

U.S. Senator John McCain (R-Arizona)

John McCain U.S. Sen. John McCain, R-Ariz., says the US shouldn't partner with Iran on Iraq. Photo: Reuters

Sen. John McCain echoed Graham’s statement that Obama's strategy against the Islamic State is flawed. McCain stressed the danger of allowing Bashar Assad's regime to gain from removing ISIS militants. Yet he voted in favor of the legislation, saying it was long overdue.

“It’s a broken, dysfunctional process that deserves and has received the scorn and disdain of the American people,” McCain said. “I’ll support it, it’s a long overdue support for brave Syrians fighting against a common terrorist enemy. The current plan could have been decisive two years ago.”