The Senate on Thursday approved legislation to fund the government for three more weeks, sending the measure to the White House. 

The 87-13 vote gives President Obama, and congressional Republicans and Democrats, another short window to reach a deal on a measure to fund the government for the rest of the year.

The outcome in the Senate was similar to a vote earlier this month that funded the government for two weeks. 

Only four more senators voted against the measure on Thursday compared to the earlier vote on March 1, when nine senators voted no. 

Nine Republicans, three Democrats and Independent Sen. Bernie SandersBernard (Bernie) SandersAnti-abortion Dem wins primary fight Lipinski holds slim lead in tough Illinois primary fight Overnight Defense: Senate sides with Trump on military role in Yemen | Dem vets push for new war authorization on Iraq anniversary | General says time isn't 'right' for space corps MORE (Vt.) voted against the measure on Thursday.

The GOP "no" votes came from Sens. John Ensign (Nev.), James InhofeJames (Jim) Mountain InhofeSenators to Trump: Keep pressure on North Korea while exploring talks Why did this administration back the Palestine Liberation Organization in terrorism case? Overnight Defense: Top general says countering Iran in Syria isn't US mission | Trump, Boeing reach 'informal' agreement for new Air Force One | Chair warns of Russian mercenaries in Syria MORE (Okla.), Rand PaulRandal (Rand) Howard PaulTrump formally sends Pompeo nomination to Senate Spending bill delay raises risk of partial government shutdown support Overnight Defense: Senate sides with Trump on military role in Yemen | Dem vets push for new war authorization on Iraq anniversary | General says time isn't 'right' for space corps MORE (Ky.), Marco RubioMarco Antonio RubioRubio: McCabe 'should've been allowed to finish through the weekend' For Tillerson, bucking Trump became a job-killer At least six dead after pedestrian bridge collapses on cars in Florida MORE (Fla.), Jim DeMint (S.C.), Orrin HatchOrrin Grant HatchNew kid on the tech block Senate GOP: Legislation to protect Mueller not needed Week ahead: Lawmakers scramble to avoid another shutdown MORE (Utah), Jim RischJames (Jim) Elroy RischOvernight Health Care: FDA takes first step to cut nicotine levels in cigarettes | Trump's health chief backs official at center of abortion fight | Trump opioid plan will reportedly include death penalty for some drug dealers Idaho, Trump officials meet on state's controversial ObamaCare plan Lawmakers trade barbs, torch Trump at DC soiree MORE (Idaho), Mike CrapoMichael (Mike) Dean CrapoPower struggle threatens to sink bank legislation Overnight Regulation: FDA rule to limit nicotine in cigarettes moves forward | Court tosses Obama financial adviser rule | House GOP threatens to hold up Senate Dodd-Frank rollback Overnight Finance: House threatens to freeze Senate Dodd-Frank rollback | New Russia sanctions | Trump vs. Trudeau on trade | Court tosses Obama financial adviser rule MORE (Idaho) and Mike LeeMichael (Mike) Shumway LeeOvernight Defense: Senate sides with Trump on military role in Yemen | Dem vets push for new war authorization on Iraq anniversary | General says time isn't 'right' for space corps Senate sides with Trump on providing Saudi military support Senate, Trump clash over Saudi Arabia MORE (Utah). Ensign, Inhofe, Rubio and DeMint voted in favor of the earlier bill.

Sens. Jay RockefellerJohn (Jay) Davison RockefellerSenate GOP rejects Trump’s call to go big on gun legislation Overnight Tech: Trump nominates Dem to FCC | Facebook pulls suspected baseball gunman's pages | Uber board member resigns after sexist comment Trump nominates former FCC Dem for another term MORE (W.Va.), Carl LevinCarl Milton LevinSen. Gillibrand, eyeing 2020 bid, rankles some Democrats The Hill's 12:30 Report Congress needs bipartisanship to fully investigate Russian influence MORE (Mich.) and Patty MurrayPatricia (Patty) Lynn MurrayOvernight Regulation: FTC to probe Facebook over user data | FDA takes step to regulating flavors in tobacco products | Congress may include background check measure in funding bill Overnight Health Care: House leaves out ObamaCare fix from funding bill | Trump appointees pushed to end teen pregnancy program | Key Dem raises concerns over potential CDC pick Top Senate Dem raises concerns over potential CDC pick MORE (Wash.) were the Democratic "no" votes. 

While more senators voted against the short-term measure, the swing against the bill was not as dramatic as in the House, where 54 Republicans voted against their leaders on Tuesday despite a whipping effort. Only six House Republicans had voted against an earlier short-term measure. More Democrats in the House also voted no this week.

Republicans opposing the short-term measure have complained it does not include language blocking funding for the new healthcare law and Planned Parenthood. That language was included in a measure funding the government for the rest of the year that was approved by the House.

Republicans have also argued that it is time to move a bill funding the government for the full year.

The new measure will keep the government funded through April 8. If the two sides do not reach a deal by then, the government would shut down.

Republican senators supporting the resolution on Thursday said it would keep the GOP on a path to meet its target for reducing spending this year.

“I think it [the stopgap] keeps us on track to achieve $61 billion in cuts to federal spending for the remainder for this year,” Sen. Jeff Sessions (R-Ala.) said in floor comments.

Some Democrats, however, voted against the measure and said it went too far in cutting needed programs. Rockefeller, for example, said the cuts simply went too far in reducing healthcare and other programs. 

The bill would reduce spending this year by $6 billion. Both the Obama administration and Senate Democrats supported many of the cuts.

The measure approved Thursday includes $2.1 billion in rescissions of funds that have not been used; $2.5 billion in earmark terminations and  $1.1 billion to financial services/general government programs.

This includes $276 million for a fund to fight flu pandemics; $225 million in funding for community service employment for older Americans; and $200 million in funding for Internet and technology projects.

White House Press Secretary Jay Carney said the three-week stopgap gives Congress “time to find common ground” on a deal to fund government for the remainder of the fiscal year.

“We all agree we want to cut spending, which is why we have already met Republicans halfway,” he said in a statement. But he said the president would continue to oppose "harmful cuts," including in the areas of education and research and development, as well as "additions to the bill that have nothing to do with fiscal policy."

The House and Senate are set to adjourn on Thursday or Friday for a weeklong recess.

This post was updated at 4:05 p.m.