Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

President Barack Obama on Thursday thanked Congress for quickly giving bipartisan approval of his request to arm and train moderate Syrian rebels to combat Islamic terrorists, saying it shows the world that Americans will not give in to fear.

“The strong bipartisan support in Congress for this new training effort shows the world that Americans are united in confronting the threat from ISIL, which has slaughtered so many innocent civilians." the president said in a brief statement from the White House.

Moments before he spoke, the Senate voted to authorize a mission to train Syrian rebels against ISIS, sending the measure to the president’s desk before lawmakers skip town for the midterm elections.

The vote on the stopgap funding bill that contained the authorization was 78 –22. Twelve Republicans and ten Democrats voted against the measure.

The vote obscured the Senate’s typical partisan lines, with opposition both from war-weary Democrats and from Republicans skeptical of President Barack Obama’s strategy to address the threat from the Islamic terror group.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

And it was further complicated by the measure’s inclusion into a larger spending bill meant to keep the federal government funded until December.

"America should only go to war to win," said Sen. Rand Paul, R-Ky., who pushed unsuccessfully for a separate vote on the authorization. "We shouldn't go to war sort-of-meandering our way through a spending bill."

"This is not Iraq. This is a totally different thing."

The politically tricky vote came less than seven weeks before the contentious November elections. Senators who are facing difficult re-election races were split on whether to arm the rebels.

Alaska Democrat Mark Begich, who's getting a tough challenge from a Republican rival, announced that he will vote against the authorization, saying in a statement that "we must have greater assurance that we aren't arming extremists who will eventually use the weapons against us."

But his fellow vulnerable Democratic incumbents Jeanne Shaheen of New Hampshire, Mark Udall of Colorado and Kay Hagan of North Carolina have all signaled that they will vote for the measure.

Both Majority Leader Harry Reid and Minority Leader Mitch McConnell backed the authorization, which Reid made a point of distinguishing from the 2002 vote to authorize the Iraq War.

“Iraq was a mistake. And I was misled,” Reid said. “And I voted wrong. But this is not Iraq. This is a totally different thing.”

Backers emphasized the narrow scope of the authorization, which applies only to the Syrian rebels and not to the larger military strategy to eradicate ISIS.

But a top Democrat also indicated that a broader authorization for military force to combat ISIS will get a vote this year.

Sen. Dick Durbin of Illinois said the Senate will draft, debate and vote on that larger authorization after the midterm elections. “I think it's long overdue,” he added.