WASHINGTON -- The Supreme Court ended its term this week with two liberal victories -- on abortion and affirmative action -- that reflect in part a deepening center-left alliance between Justices Anthony M. Kennedy and Stephen G. Breyer.

Breyer is the most moderate of the court's four Democratic appointees, and Kennedy is easily the most moderate of the four Republican appointees. Both share an interest in deciding cases based on a practical assessment of the facts, and not rigid doctrines or legal ideology.

This term, Kennedy and Breyer -- the court's only two California natives -- voted together more than 91 percent of the time, among the highest rates of agreement of any two justices this term, according to the Scotusblog website.

And history has shown when the court is closely split between liberals and conservatives -- as it has been since the February death of Justice Antonin Scalia -- it's often the moderates who take on a more prominent role.

Because court proceedings are private, it's difficult to know whether the agreement between Kennedy and Breyer is merely coincidence, a reflection of caseloads or the result of mutual influence.

But in recent years, clerks have noted that Breyer and Kennedy are often seen around the court building talking about cases.

Their agreement is also apparent in decisions. Kennedy provided the key fifth vote in the abortion and affirmative action decisions. Breyer, meanwhile, joined Kennedy and other conservatives in recent rulings on criminal justice and search warrants.

Perhaps the clearest sign of their bond was when Kennedy chose Breyer to write the opinion in the abortion case. As the senior justice in the majority, Kennedy could have written the decision or assigned the important case to one of the female justices. But Kennedy appears to have had more confidence that the like-minded Breyer would craft an opinion he could sign.

Neal Katyal, a Washington lawyer and former acting U.S. solicitor general, said Breyer has the right demeanor for building friendships over time. After Justice Sandra Day O'Connor retired in 2006, Breyer said he was in mourning because she was so reasonable and open-minded, and he greatly missed discussing cases with her.

"Since the time I clerked for him, I have always been struck by the way he approaches controversy. He doesn't get angry or tart, even when one of his colleagues pens something that is harsh," Katyal said. "This isn't strategic. He genuinely respects people who think differently and values the differences. So it's not surprising to me that he has forged alliances in important cases with Justice Kennedy."

Breyer, 77, grew up in San Francisco, graduated from Stanford University and Harvard Law School. The lifelong Democrat lived and worked in Boston before he was appointed to the high court.

Kennedy, 79, was raised in Sacramento and, like Breyer, has degrees from Stanford and Harvard Law School. The lifelong Republican joined the high court in 1988, the last appointee of President Ronald Reagan.

Whereas Kennedy is known for his sweeping rhetoric, Breyer rarely writes strong opinions or bold dissents.

He "takes an evidence-driven approach. He wants to understand how the world works and how the law operates given the realities on the ground," said Brianne Gorod, counsel for the Constitutional Accountability Center and former law clerk for Breyer.

When this term began in the fall, the court faced a lineup of cases that appeared to favor conservatives on issues that included unions, immigration, abortion and voting districts. But Scalia's death changed those calculations.

Instead, for the second year in a row, the court tilted to the left in its major decisions. Last year, the justices ended their term with historical rulings that legalized same-sex marriages nationwide and upheld President Barack Obama's health care plan for a second time.

"The Supreme Court term that ended Monday was more liberal than many had predicted and stranger than anyone could have anticipated," said Steven Shapiro, legal director of the American Civil Liberties Union.

The rulings on abortion and affirmative action are likely to have the most lasting impact.

Breyer spoke for a 5-3 majority to reject a Texas law and similar ones in the South and Midwest that set special medical standards for abortion clinics. Although lawmakers said they sought to protect the health and safety of women, Breyer said a careful look at the evidence showed the measures would mostly make it harder for women to obtain a legal abortion.

Throughout his career, Kennedy has remained uncomfortable with the issue of abortion. He is Catholic and personally opposed to abortion. In 1992, he cast the crucial fifth vote with some reluctance to affirm the right to abortion. But in 2007, he wrote an opinion upholding a ban on so-called partial-birth abortions that take place late in a pregnancy.

There is reason to think Kennedy changed his mind on the Texas abortion law. In the fall of 2013, the Supreme Court by a 5-4 vote allowed Texas to enforce a provision that required all abortion doctors to have admitting privileges at nearby hospitals. At the time, Breyer wrote a dissent saying the law would shut down about half of the clinics and leave rural women with few options.

But this spring when justices made their initial vote in the abortion case, Kennedy sided with Breyer and the three female justices to strike down the law entirely.

Kennedy also appears to have moderated his views on affirmative action. In the past, he had been skeptical of race-based affirmative action policies. He surprised many with his opinion last week concluding a University of Texas policy could be upheld because it was limited in its scope.

"This suggests that in areas where Justice Kennedy has conflicting impulses -- whether to allow consideration of race, whether to allow restrictions on abortion -- he can sometimes be persuaded by evidence about how the laws or programs actually operate and the effects that they can have," Gorod said.

In criminal cases, Breyer has often voted with Kennedy in support of law enforcement. Last week, he cast a key vote in a 5-3 opinion that upheld the admissibility of drug evidence found on a man who was questioned outside a suspected drug house and found to have an outstanding warrant. The decision drew a fiery dissent from Justice Sonia Sotomayor, who said it could encourage the police to stop and question even more young black and Latino men.

Three years ago, Breyer also cast a fifth vote with Kennedy in a crucial DNA case that prompted an angry dissent from Scalia. At issue was whether police could take a mouth swab for DNA from anyone arrested for a serious crime. These DNA tests have been crucial for identifying serial rapists, but Scalia and the three liberal justices argued this mouth swab was a search that required a warrant.

"I doubt that the proud men who wrote the charter of our liberties would have been so eager to open their mouths for royal inspection," Scalia wrote in dissent.

Kennedy and Breyer thought this made no sense. Police can fingerprint people who are arrested, and those fingerprints can be used to charge people with other crimes. DNA samples are at most "a minor intrusion" on the privacy of someone who has been arrested, Kennedy said in Maryland vs. King, which upheld laws across the nation.