SAN ANTONIO — The Texas attorney general who tried to orchestrate President Trump's last stand spent most of his career under indictment for state securities fraud, but his closeness to the president had buffed that tarnish. Trump listens to Ken Paxton. He called so often the White House once caught him in the shower. And the state attorney general had the digits to call him back.

Paxton’s star seemed ascendant as he positioned himself as one of Trump’s biggest allies, willing to fight legal battles on sanctuary cities, the Affordable Care Act and now the outcome of the presidential election. But the shadows over Texas’s folksy attorney general have been growing longer. Trump has lost the election. Paxton’s last-gasp effort to overturn the outcome via the U.S. Supreme Court has failed. His top deputies recently reported him to the FBI for alleged crimes such as bribery. And the Associated Press has reported that he cheated on his wife, Angela Paxton, who is a Republican state senator in Texas.

Paxton, a tea party darling known as a shrewd politician, did not respond to requests for comment, but he appeared cheerful Thursday as he spoke to a conservative commentator on YouTube before heading into the Oval Office to talk about his petition seeking to dismiss the election results.

“It’s our last chance, and it may be our last chance forever,” Paxton said in an interview with conservative commentator Steven Crowder. “Because if this gets set this way, I mean, we may never have elections again that we can count on.”

After he spoke, the Austin American-Statesman reported that FBI agents served at least one subpoena at his office 1,500 miles away. The FBI declined to comment.

In a news release, Paxton had alleged that the battleground states of Pennsylvania, Wisconsin, Michigan and Georgia — where President-elect Joe Biden’s victories had swung the election — “exploited the COVID-19 pandemic to justify ignoring federal and state election laws and unlawfully enacting last-minute changes, thus skewing the results of the 2020 General Election.”

Among the claims: Republicans were blocked from challenging ballots, poll workers cheered when observers were ejected, and equipment was missing, stolen or left unattended. Trump’s lawsuits in those states already had failed. The Supreme Court ruled Friday that it would not hear arguments.

Democrats and some Republicans had condemned Paxton’s lawsuit — one he began alone before other GOP-led states and dozens of members of Congress agreed to join him — saying it was endangering democracy. Rep. Chip Roy (R), who was Paxton’s top lieutenant before resigning in 2016, has called on him to resign.

Paxton’s move frayed the often-cordial relationship among attorneys general, usually serious-minded lawyers doing the people’s work: Republicans and Democrats have joined forces against Big Tobacco, banking and in antitrust probes into Google. Paxton, the top prosecutor in one of the largest U.S. states, was among 48 attorneys general joining in the antitrust lawsuit against Facebook.

But critics view Paxton as Trump’s “gun for hire,” said Sean Rankin, executive director of the Democratic Attorneys General Association. Paxton has fought to endthe Affordable Care Act, which provides health care to low-income families, and he went to court to block El Paso County from imposing a lockdown as the coronavirus engulfed it. He also fought to stop the expansion of mail-in voting.

“He’s politically expedient,” Rankin said. “The lawsuits he files, the decisions he makes, how he runs this office — it’s not based upon being the people’s lawyer. . . . They’re no longer doing the people’s will. They’re doing the will of extreme elements in the Republican Party.”

Paxton, 57, spent much of his childhood in California — his father was in the Air Force — and went to college in Texas and then law school at the University of Virginia. He later returned to Texas, north of Dallas, and won election in a deeply conservative, affluent, mostly White area, first to the state House of Representatives and then the Senate.

In 2014, he won the first of his two terms as state attorney general, calling himself “a conservative, stalwart leader with a deep passion and respect for our U.S. Constitution.”

“He is known for his principled and uncompromising devotion to America’s founding values,” his campaign website says.

Months after taking office in 2015, a county grand jury indicted Paxton on criminal charges of acting as an unregistered investment adviser and securities fraud. As a member of the Texas House, he had voted for the bill that made such activities felonies; he has pleaded not guilty.

Details emerged in a federal civil case brought against him by the U.S. Securities and Exchange Commission. He allegedly raised $840,000 from friends, business associates, clients and investors for a computer hardware company that claimed to have invented a “revolutionary new server,” without telling investors that he was being compensated for promoting the stock, according to federal court records.

Paxton pitched it as “a great company,” though he had not investigated it, court records said. In one late-night phone call, he persuaded one skeptic to change their mind and pitch in $150,000.

U.S. District Judge Amos L. Mazzant III in Texas dismissed the case in 2017 because he said Paxton had no legal obligation to make the disclosures.

“The question before the Court is not whether Paxton should have disclosed his compensation arrangement but whether Paxton had a legal duty under federal securities law to disclose,” wrote Mazzant, an appointee of President Barack Obama.

Paxton has cast the allegations against him as a witch hunt motivated by more moderate factions of the state Republican Party. He has been backed by ultraconservative, wealthy donors as well as U.S. Sen. Ted Cruz (R-Tex.).

State prosecutors noted Paxton did not contest a 2014 civil fine of $1,000 and a reprimand from the Texas State Securities Board.

“We’ve alleged that it was knowing and intentional. It wasn’t an accident,” said special prosecutor Kent Schaffer.

Paxton’s defense attorney Philip Hilder was blunt: “Paxton is innocent of these allegations.”

The alleged offenses took place when Paxton was a state representative, years before he would become attorney general.

Now, as the state’s top prosecutor, Paxton has assembled a stellar team of respected litigators and investigators and has taken aim at what they see as the excesses of the executive branch in Washington. Buoyed by a powerful political action committee, Empower Texans, Paxton went after election fraud, Planned Parenthood and voting rights.

Trump’s election elevated his status even more. Paxton talked to the president and visited often, at least once a month.

“I’ve been around him a lot,” Paxton said in mid-February on a Texas podcast called “Y’all-itics,” a riff on the Texas drawl. “I’m unexpectedly surprised at my access and how much I’ve been able to work with him and, if I have issues, how many times I’ve convinced him to side with us sometimes in opposition to some of his own White House counsel.”

But in Texas, his reputation struggled. He won reelection by just three percentage points in 2018.

Then members of his prized legal team signed a letter saying they had reported Paxton to the authorities for potential crimes such as “improper influence, abuse of office and bribery.” They alleged that Paxton abused his office and cut deals on behalf of a political donor, Austin real estate developer Nate Paul, who did not respond to questions from The Washington Post. The AP reported that Paul had hired, on Paxton’s recommendation, a former state Senate aide with whom Paxton had had an affair.

Several of the letter-signers then filed a whistleblower lawsuit alleging that Paxton retaliated against them, badmouthing them and firing most of his critics. The lawsuit alleges that Paul had bad business deals, bankruptcies and was under FBI investigation, and Paxton sought to help him, interfering with public-records requests and a lawsuit.

The lawsuit called Paxton’s alleged behavior “increasingly reckless, bold, and apparent” and said the staff was “increasingly concerned that Paxton was becoming “less rational in his decision-making.”

Democrats and Paxton’s critics say his entering the fray of Trump’s election battle is one of two things: an effort to seek a presidential pardon or to shore up his conservative credentials to hold off an expected reelection challenge in 2022 from George P. Bush, son of former Florida governor Jeb Bush.

“The smartest thing Donald Trump can do is to get as far away from Ken Paxton as possible, and I say this as a Trump supporter,” said attorney Ty Clevenger, who encouraged the Collin County grand jury to investigate the Paxton allegations years ago. He also filed a complaint against Paxton with the bar association. “Paxton is so self-destructive that he is going to crash and burn. Anyone in Paxton’s orbit will end up with mud on their face.”

Brian Wice, one of the special prosecutors appointed to the securities-fraud case five years ago, said a presidential pardon would not affect the state criminal charges. “And not even a preemptive presidential pardon is going to change that.”

Paxton has flatly denied his former legal team’s allegations and said they were “rogue” employees.

During a podcast at an Austin dive bar in February, Paxton said he thought Trump would win the election. His name had been mentioned as a possibility for U.S. attorney general, but he brushed that aside, saying “you just never know what’s going to happen.”

“Almost every politician I know thinks they’re going to be here forever,” he said on “Y’all-itics.” “And the reality is most of them leave before they think they’re going to because of financial issues, or they get beat, or they have health issues or personal issues, whatever they are.”

Sacchetti reported from Washington.