Sotomayor, President Barack Obama's first Supreme Court nominee, will be sworn in Saturday as the court's 111th justice, third woman and first nominee by a Democrat in 15 years.
The Senate vote was 68-31.
The 55-year-old daughter of Puerto Rican parents was raised in a New York public housing project and educated in elite universities before rising to the highest legal echelons, spending the past 17 years as a federal judge.
A majority of Republicans lined up against her, arguing she would bring personal bias and a liberal agenda to the bench. But Democrats praised Sotomayor as an extraordinarily qualified mainstream moderate and touted her elevation to the court as a milestone in the journey toward greater equality in the U.S. and a reaffirmation of the American dream.
Obama, the first black U.S. president, praised the Senate's vote as "breaking another barrier and moving us yet another step closer to a more perfect union."
Minutes before the vote, Sen. Robert Menendez, the Senate's lone Hispanic Democrat, said, "History awaits, and so does an anxious Hispanic community in this country."
"When she places her hand on the Bible and takes the oath of office, the new portrait of the justices of the Supreme Court will clearly reflect who we are as a nation, what we stand for as a fair, just and hopeful people."
The Senate chamber was heavy with drama as senators took the rare step of assembling at their desks for the vote, rising from their seats to call out "aye" or "nay." The longest-serving senator, 91-year-old Robert Byrd who has been in frail health following a long hospitalization, was brought in in a wheelchair to vote in Sotomayor's favor. Edward Kennedy, a Democrat suffering from brain cancer, was the only senator absent.
Sotomayor replaces retiring Justice David Souter, a liberal named by a Republican president, and she is not expected to alter the court's ideological split.
Still, Republicans and Democrats were deeply at odds over confirming Sotomayor, and the battle over her nomination highlighted profound philosophical disagreements that will shape future fights over the court's makeup as Obama looks to another likely vacancy - perhaps more than one- while he's in the White House.
The Republicans decried Obama's call for "empathy" in a justice, painting Sotomayor as the embodiment of an inappropriate standard that would let a judge bring her personal whims and prejudices to the bench.
Her writings and speeches "reflect a belief not just that impartiality is not possible, but that it's not even worth the effort," said Sen. Mitch McConnell, the Republican minority leader. "In Judge Sotomayor's court, groups that didn't make the cut of preferred groups often found that they ended up on the short end of the empathy standard."
Democrats, for their part, hailed the vote as a breakthrough achievement for the country, on par with enactment of civil rights laws. They warned Republicans they risked a backlash from Hispanic voters in the short term and an enduring black mark on their party in history books by opposing Sotomayor's confirmation.
"Those who oppose her for fear of her unique life experience do no justice to her or our nation. Their names will be listed in our nation's annals of elected officials one step behind America's historic march forward," said Sen. Dick Durbin of Illinois, the No. 2 Democrat.
A number of Republican senators argued Sotomayor's speeches and record made her unacceptable. They pointed to rulings in which they said she showed disregard for gun rights, property rights and job discrimination claims by white employees. And they repeatedly cited comments she had made about the role that a judge's background and perspective can play, especially a 2001 speech in which she said she hoped a "wise Latina" judge would usually make better decisions than a white man.
"She has bluntly advocated a judicial philosophy where judges ground their decisions not in the objective rule of law, but in the subjective realm of personal 'opinions, sympathies and prejudices,'" said Sen. Jeff Sessions, the top Republican on the Judiciary Committee.
Republicans have been particularly critical of Sotomayor's position on the U.S. Constitution's Second Amendment right to keep and bear arms. She was part of a federal appeals court panel in New York that ruled this year that the amendment limits only the federal government - not states - a decision in keeping with previous Supreme Court precedent. Gun rights supporters said her panel should not have called the issue "settled law," and they criticized her for refusing during her confirmation hearings to go beyond what the high court has said and declare that the Second Amendment applies to the states.
The National Rifle Association, a gun rights advocacy group, strongly opposed her and threatened to downgrade its ratings of any senator who voted to confirm Sotomayor. The warning made little impact on Democrats, but it may have influenced some Republicans who were initially considered possible supporters but have since announced their opposition, citing gun rights as a key reason.
In the final tally, nine Republicans joined majority Democrats and the Senate's two independents to support Sotomayor's confirmation. They included the Senate's few Republican moderates and its lone Hispanic Republican, retiring Sen. Mel Martinez, as well as conservative southern Sens. Lindsey Graham and Lamar Alexander, the party's third-ranking leader.