Washington (CNN) The Senate Thursday approved on a largely party line vote a budget bill that would repeal Obamacare and defund Planned Parenthood , two top priorities of Republicans who control the chamber.

Not to be outdone, Democrats seized the debate to try to force votes on gun control legislation that could put some Republicans in a politically tough position as the country is reeling from a recent spate of mass shootings.

Howard Unruh, a World War II veteran, shot and killed 13 of his neighbors in Camden, New Jersey, in 1949. Unruh barricaded himself in his house after the shooting. Police overpowered him the next day. He was ruled criminally insane and committed to a state mental institution.

Howard Unruh, a World War II veteran, shot and killed 13 of his neighbors in Camden, New Jersey, in 1949. Unruh barricaded himself in his house after the shooting. Police overpowered him the next day. He was ruled criminally insane and committed to a state mental institution.

Officers in Austin, Texas, carry victims across the University of Texas campus after Charles Joseph Whitman opened fire from the school's tower, killing 16 people and wounding 30 in 1966. Police officers shot and killed Whitman, who had killed his mother and wife earlier in the day.

Officers in Austin, Texas, carry victims across the University of Texas campus after Charles Joseph Whitman opened fire from the school's tower, killing 16 people and wounding 30 in 1966. Police officers shot and killed Whitman, who had killed his mother and wife earlier in the day.

Prison guard George Banks is led through the Luzerne County courthouse in 1985. Banks killed 13 people, including five of his children, in Wilkes-Barre, Pennsylvania, in September 1982. He was sentenced to death in 1993 and received a stay of execution in 2004. His death sentence was overturned in 2010.

Prison guard George Banks is led through the Luzerne County courthouse in 1985. Banks killed 13 people, including five of his children, in Wilkes-Barre, Pennsylvania, in September 1982. He was sentenced to death in 1993 and received a stay of execution in 2004. His death sentence was overturned in 2010.

In October 1991, George Hennard crashed his pickup through the plate-glass window of Luby's Cafeteria in Killeen, Texas, before shooting 23 people and committing suicide.

Eric Harris, left, and Dylan Klebold brought guns and bombs to Columbine High School in Littleton, Colorado, in April 1999. The students gunned down 13 and wounded 23 before killing themselves.

Pallbearers carry a casket of one of Michael McLendon's 10 victims. McLendon shot and killed his mother in her Kingston, Alabama, home, before shooting his aunt, uncle, grandparents and five more people. He shot and killed himself in Samson, Alabama, in March 2009.

Jiverly Wong shot and killed 13 people at the American Civic Association in Binghamton, New York, before turning the gun on himself in April 2009, police said. Four other people were injured at the immigration center shooting. Wong had been taking English classes at the center.

A military jury convicted Army Maj. Nidal Hasan of 13 counts of premeditated murder for a November 2009 shooting rampage at Fort Hood, Texas. Thirteen people died and 32 were injured.

Connecticut State Police evacuate Sandy Hook Elementary School in Newtown, Connecticut, in December 2012. Adam Lanza opened fire in the school, killing 20 children and six adults before killing himself. Police said he also shot and killed his mother in her Newtown home.

Police officers walk on a rooftop at the Washington Navy Yard after a shooting rampage in the nation's capital in September 2013. At least 12 people and suspect Aaron Alexis were killed, according to authorities.

A man kneels across the street from the historic Emanuel African Methodist Episcopal Church in Charleston, South Carolina, following a shooting in June 2015. Police say the suspect, Dylann Roof, opened fire inside the church, killing nine people. According to police, Roof confessed and told investigators he wanted to start a race war. He was eventually convicted of murder and hate crimes, and a jury recommended the death penalty.

Police search students outside Umpqua Community College after a deadly shooting at the school in Roseburg, Oregon, in October 2015. Nine people were killed and at least nine were injured, police said. The gunman, Chris Harper-Mercer, committed suicide after exchanging gunfire with officers, a sheriff said.

In December 2015, two shooters killed 14 people and injured 21 at the Inland Regional Center in San Bernardino, California, where employees with the county health department were attending a holiday event. The shooters, Syed Rizwan Farook and his wife Tashfeen Malik, were later killed in a shootout with authorities. The pair were found to be radicalized extremists who planned the shootings as a terror attack, investigators said.

Police direct family members away from the scene of a shooting at the Pulse nightclub in Orlando in June 2016. Omar Mateen, 29, opened fire inside the club, killing at least 49 people and injuring more than 50. Police fatally shot Mateen during an operation to free hostages that officials say he was holding at the club.

A couple huddles after shots rang out at a country music festival on the Las Vegas Strip on Sunday, October 1, 2017. At least 58 people were killed and almost 500 were injured when a gunman opened fire on the crowd. Police said the gunman, 64-year-old Stephen Paddock, fired from the Mandalay Bay hotel, several hundred feet southwest of the concert grounds. He was found dead in his hotel room, and authorities believe he killed himself and that he acted alone. It is the deadliest mass shooting in modern US history.

Investigators at the scene of a mass shooting at the First Baptist Church in Sutherland Springs, Texas, on Sunday, November 5, 2017. A man opened fire inside the small community church, killing at least 25 people and an unborn child. The gunman, 26-year-old Devin Patrick Kelley, was found dead in his vehicle. He was shot in the leg and torso by an armed citizen, and he had a self-inflicted gunshot to the head, authorities said.

Parents wait for news after a shooting at Marjory Stoneman Douglas High School in Parkland, Florida, on Wednesday, February 14. At least 17 people were killed at the school , Broward County Sheriff Scott Israel said. The suspect, 19-year-old former student Nikolas Cruz, is in custody, the sheriff said. The sheriff said he was expelled for unspecified disciplinary reasons.

By voting to nullify Obamacare -- the signature domestic accomplishment of the Obama administration -- GOP congressional leaders fulfilled a longtime pledge to voters and rank-and-file members to get a repeal to President Barack Obama's desk, even though he will veto it.

Republican leaders also want to send an unmistakable message to voters: If you elect a GOP president next year and keep the them in charge of Congress, Obamacare will go.

"It demonstrates that if you have a president prepared to support health care reform, it could pass next time," said Sen. Jeff Sessions, R-Alabama, a vocal critic of the Affordable Care Act who insisted this was not a show vote just because the President will veto the bill. "If this vote occurred after the next presidential election, instead of vetoing it the President would sign it. This would force a bipartisan reevaluation of health care in America and put us in a position to make major changes."

The bill would also cut off federal funding to Planned Parenthood, the women's health group that provides abortions and has long under GOP scrutiny. Republicans' passions to cutoff taxpayer dollars to the organization increased in recent months when videos were released that purported to show Planned Parenthood executives selling the tissue of aborted fetuses to researchers.

While the House and Senate have voted scores of times to repeal portions of Obamacare, this was the first time they are using a special tool known as "budget reconciliation" that allow the measure to clear the Senate with just 51 votes instead of the 60 votes typically required for major legislation. That higher threshold has allowed Democrats to block all past repeal efforts.

By steering these two hot-button issues into the reconciliation bill, Republican leaders also steered them away from a separate must-pass government funding bill Congress is dealing with now known as the omnibus. Had those controversial issues been included in that bill, it would have made even harder to pass before the December 11 deadline when the government could shut down.

JUST WATCHED Democrats on edge over Obamacare Replay More Videos ... MUST WATCH Democrats on edge over Obamacare 02:11

As with Obamacare, Senate Democrats have blocked recent efforts to defund the organization so the reconciliation bill became the GOP's best option to move the measure.

"Middle class Americans continue to call on Washington to build a bridge away from Obamacare. They want better care. They want real health reform," argued Senate Majority Leader Mitch McConnell . "For too long, Democrats did everything to prevent Congress from passing the type of legislation necessary to help these Americans who are hurting. Today that ends."

During floor debate, Republicans recounted with frustration the 7 a.m. vote on Christmas Eve morning in 2009 when the 60 Democrats who held a filibuster-proof margin of control "crammed" the bill through Senate, in Sessions' words, without a single Republican vote.

"The American people knew this wouldn't work, they opposed it from the beginning. They opposed the philosophy of it and they knew we were going to have a mess on our hands," Sessions said.

Others, like Sen. John Cornyn of Texas, the second-ranking Senate Republican, argued there was no way for the law to be sustained in the long run without GOP backing. "It was a terrible mistake," Cornyn said about the way Democrats and the President pushed the bill through.

Democrats countered that Republicans were wasting time with more political show votes.

"What they're doing on this reconciliation is just going nowhere," said Senate Minority Leader Harry Reid on Tuesday. "They want to do this to satisfy a few radical right-wing people who they have joined forces with. Another charade may make some Republican senators feel better, but it won't make law."

Democrats launch gun control debate

In recent months, many Senate Democrats have grown increasingly agitated at their inability to respond to the growing number of mass shootings across the country and pass tougher gun control legislation and measures to help mentally unstable people before they carry out a tragedy. Their last major effort came after 20 children and 6 adults were killed by a gunman in Newtown, Connecticut, three years ago.

Even then, a bipartisan measure from Sen. Joe Manchin, D-West Virginia and Sen. Pat Toomey, R-Pennsylvania to expand background checks failed.

Democrats took advantage of the special rules of debate to push for votes on gun-related measures Republicans probably would not have allowed.

Photos: The 2016 candidates stances on gun control Photos: The 2016 candidates stances on gun control Hide Caption 1 of 9 Photos: The 2016 candidates stances on gun control Hide Caption 2 of 9 Photos: The 2016 candidates stances on gun control Hide Caption 3 of 9 Photos: The 2016 candidates stances on gun control Hide Caption 4 of 9 Photos: The 2016 candidates stances on gun control Hide Caption 5 of 9 Photos: The 2016 candidates stances on gun control Hide Caption 6 of 9 Photos: The 2016 candidates stances on gun control Hide Caption 7 of 9 Photos: The 2016 candidates stances on gun control Hide Caption 8 of 9 Photos: The 2016 candidates stances on gun control Hide Caption 9 of 9

"The entire country will know where every member of the Senate stands on tightening background checks, on keeping guns out of the hands of terrorists, and on strengthening and improving mental health in this country," said Sen. Chuck Schumer of New York. "The scourge of gun violence that has swept through this country in recent years has snuffed out thousands upon thousands of lives. It's an epidemic that must be dealt with head on and that means keeping guns out of the hands of people who should not have guns."

Democrats brought up the Manchin-Toomey measure, a proposal from Sen. Dianne Feinstein of California that would prevent people on the terror watch list from buying guns, and a third amendment to strengthen mental health and substance abuse treatment all failed. Each was blocked from getting 60 votes to advance. Republicans offered alternatives to each and they were blocked as well.

Three Republicans besides Toomey voted for the expanded background check legislation: Sens. John McCain of Arizona, Mark Kirk of Illinois and Susan Collins of Maine. Democrat Heidi Heitkamp of North Dakota also voted against the amendment.

The other amendments fell on party lines.

Some moderate Republicans also tried to thread the needle on the budget during the Planned Parenthood debate. Collins, Kirk, and Lisa Murkowski of Alaska offered an amendment that would have stripped the defunding language, but it was defeated.

Kirk and Collins were the only Republicans to vote against the final bill.

One bit of drama on the final vote was whether GOP presidential candidates Sens. Ted Cruz of Texas and Marco Rubio of Florida would support the bill. They had complained the Obamacare repeal was not deep enough but Senate GOP leaders made changes to satisfy them and were confident they would back the bill, especially because pro-life groups adamantly support defunding Planned Parenthood and the candidates are courting those pro-life voters.

In the end, they both voted for the bill.

The debate included a wide variety of issues including a proposal from Sen. Rand Paul of Kentucky, a GOP presidential candidate, to curb Syrian refugees from coming into the U.S. but his measure failed to get 60 votes.

The bill, which was approved on a 52-47 vote, now goes back to the House, which is expected to adopt it and send it to the President for his veto.