Antonio Villaraigosa once worked for a teachers union, married a teacher and jumped into politics with educators and their labor unions in his corner.

But that was a long time ago.

As he competes for one of the top two places in the June 5 primary for governor and a spot in the fall runoff, the former Los Angeles mayor is being backed by education reformers and charter school advocates looking to put an ally in the state’s top job. The state’s teachers unions are spending big to try to elect Villaraigosa’s fellow Democrat Gavin Newsom.

Teachers at charter schools typically don’t belong to unions, and public employee unions are among California Democrats’ most reliable funding sources — making Villaraigosa and his support of charters something of an outlier in the party.

In the 24 years since his first election to the Assembly, Villaraigosa has been what could be described as a moderate maverick when it comes to education — passionate about public schools, supportive of choice and charter schools, and critical of teachers unions for their support of such policies as tenure and layoffs by seniority.

A pro-charter political group has given Villaraigosa’s gubernatorial campaign a big boost in recent weeks, raising more than $16 million to put ads on TV statewide. Its largest donors are three billionaires — Netflix founder Reed Hastings, entrepreneur philanthropist Eli Broad and venture capitalist William Oberndorf.

“In every facet of (Villaraigosa’s) life ... he’s worked to improve our public schools in California,” said Gary Borden, executive director of the California Charter School Association Advocates, the independent expenditure group. “For him, it’s real, it’s honest and part of who he is.”

The charter group is trying to push Villaraigosa closer in the polls to front-runner Newsom, who has the backing of teachers unions and other education establishment groups that have raised about $6.5 million for the gubernatorial campaign.

Supporters of charter schools believe parents need more choice within the public system, where they say many schools are failing students. Opponents of charters say they turn schools into businesses, and that public-school teachers are unfairly being blamed for broader problems that are beyond their control.

“The charter issue becomes a way for candidates and their teams to signal to both the general public and insiders where they stand,” said John Rogers, UCLA professor of education.

“Villaraigosa is suggesting to a small number of people who can exert influence that he’s going to be with this set of billionaire entrepreneurs,” Rogers said. “Newsom is suggesting he’s going to be aligned with and follow the lead of certain key unions.”

Newsom’s campaign has said he believes charter schools have a place in the education system, but that he believes new approvals should be “paused” until more “transparency measures” can be put in place.

Villaraigosa has made his support of charters clear on his campaign website, declaring: “Wealthy families can choose to move to high-performing school districts, or pay for private school tuition. Poor families also deserve the right to access high-quality schools and publicly chartered schools often provide that access.”

Villaraigosa started his career as an organizer for a local teachers union, but became an ally of education reformers starting in his years in the Assembly and then as mayor of Los Angeles.

In the Legislature, Villaraigosa authored a bill that enabled districts to identify veteran, tenured teachers who weren’t doing a good job. He said the idea was to ensure they received support to improve. He also helped push through a $9 billion facilities bond that included funding for charter schools.

During his eight years as mayor, he sought to have the city take over the Los Angeles school district, a plan backed by Broad and opposed by the teachers union and school board. At the time, Villaraigosa said union leaders were an “unwavering roadblock to reform.”

He persuaded the Legislature and then-Gov. Arnold Schwarzenegger to approve the takeover, but opponents sued and blocked it in court. Villaraigosa then created a nonprofit that ultimately took control of the school district’s 21 lowest-performing schools.

The nonprofit’s first director was Marshall Tuck, who is running for state superintendent of public instruction, also with support from Broad.

Villaraigosa has pointed to an increase in graduation rates in Los Angeles from 44 percent in 2005, when he became mayor, to 72 percent when he left office in 2013 as evidence that his approach worked. Whether he deserves credit for the increase has been widely debated, because the mayor has no official control over the school district.

After leaving the mayor’s office, Villaraigosa declared his support for the so-called Vergara lawsuit, filed in 2012, which claimed that tenure and seniority policies resulted in “grossly ineffective” teachers retaining their jobs and therefore denying California students their constitutional right to an education. Plaintiffs scored an initial victory in Los Angeles Superior Court, but the verdict was overturned on appeal.

Villaraigosa’s campaign says he’s not anti-union, and points to an endorsement this week by the International Union of Painters and Allied Trades.

Mónica García, president of the Los Angeles school board, said she’s known Villaraigosa for 15 years and that he can bring labor and business together on education issues.

“He was about collaboration, bringing in multiple voices,” she said of his work on education and children’s issues. “He was willing to be tough on all of us.”

Steve Smith, spokesman for the 2.1 million-member California Labor Federation, thinks Villaraigosa has strayed far from his union roots. The federation has endorsed Newsom.

“There certainly has been an evolution there,” Smith said of Villaraigosa. “Looking at the recent influx of very large donations from billionaire charter backers, that’s a huge concern for us.”

Villaraigosa’s campaign says voters should be suspicious of unions’ motives in spreading around millions of dollars for Newsom.

“Mayor Villaraigosa’s focus is how we unite Californians to lift more families into the middle class and keep them there,” said his campaign spokesman, Luis Vizcaino. “This campaign isn’t going to be distracted from that mission by outside efforts for us or against us.”

Jill Tucker is a San Francisco Chronicle staff writer. Email: jtucker@sfchronicle.com Twitter: @jilltucker