Craig Richards, Gov. Bill Walker's former law partner and one of his closest confidants, abruptly announced his resignation as attorney general on Thursday, effective immediately.

Richards, 41, with a background in finance and oil and gas law, had weathered rough patches with Democrats over social issues and Republicans over oil policy. He was the architect of the Walker administration's plan to reshape the Alaska Permanent Fund, lowering dividends but ensuring a stable revenue source for state government.

Richards said in a written statement in which the governor also prepared remarks that he was stepping down "to re-focus on my family."

Walker said he accepted the resignation reluctantly.

"As the state's top attorney, work has pulled him away from his 3-year-old son, and I am grateful for the sacrifices he and his family have made in service to Alaska," Walker said.

Richards was a controversial appointment to the top lawyer post. Yet from the start, he was part of the governor's tight inner circle, a group that also includes first lady Donna Walker and Jim Whitaker, the governor's chief of staff, said state Sen. Bill Wielechowski, D-Anchorage, and a member of the Senate Judiciary Committee.

Neither Richards nor Walker were giving interviews on the resignation, their spokeswomen said. A message left on Richards' work cellphone was not returned.

On May 31, Richards and his wife, Alyson, filed a petition in Anchorage Superior Court to dissolve their marriage but the matter hasn't been decided. A hearing is scheduled for July.

"It is with a heavy heart that I announce my resignation as attorney general," Richards said in the written statement. "I support the governor and was honored to serve as the head of the State's legal team. My reasons for leaving are personal. I feel I need to re-focus on my family, which is impractical given the travel and workload requirements of the job. "

His staff was surprised by the immediate resignation, according to Law Department spokeswoman Cori Mills, as were legislators.

"On a personal note, serving as attorney general has been the opportunity of a lifetime," Richards said in an email to staff Thursday morning, just before the public announcement.

House Speaker Mike Chenault is among the members who had expressed concerns with Richards and his various roles in the Walker administration.

"That's kinda odd," Chenault said. "To announce it today and to be gone today, it is kinda interesting."

Richards, an avid hunter and social conservative, is a self-described "redneck from Fairbanks," where he grew up.

Walker appointed him to the cabinet post atop the 550-employee department in December 2014. In April 2015, Richards won confirmation to serve as attorney general on a split 36-to-23 vote of the full 60-member Legislature.

Richards had upset some Democrats before his confirmation when he signed on to a U.S. Supreme Court brief with 15 other states fighting the right of gay people to marry. Walker had won election as an independent on a ticket with Democrat Byron Mallott, and defending the state ban on same-sex marriage seemed to disrupt an implied pact to steer clear of social issues, Wielechowski said.

But he wasn't a favorite of Republicans, either. His prickly relationship with oil producers was one concern. Before Walker's election, Richards led their law firm's fight against the state and the oil industry for higher property tax assessments of the trans-Alaska oil pipeline, benefiting municipalities and costing the industry tens of millions of dollars.

Just recently, he pressured Tesoro to give up a fuel storage terminal at the Port of Anchorage to avoid creating a monopoly.

"He was not afraid to make strong decisions that protected consumers in Alaska that industry didn't like," Wielechowski said.

"I have tremendous respect for him. I think he brought a lot to state government. I am going to miss him as attorney general. I think he started to settle in."

Richards took on high-profile roles in the Walker administration's effort to close the state's multibillion-dollar budget gap and to develop a natural gas pipeline. He served on the Alaska Permanent Fund Corp. board and was appointed to other boards and committees.

Chenault and other leading representatives thought he had too many roles and wanted him off the Permanent Fund board in particular. But a bill they proposed to separate those roles for future attorneys general died in a House committee.

Walker now must appoint a new Permanent Fund board member. Others from the Department of Law are filling most of Richards' other roles.

Walker named Jim Cantor, deputy attorney general, to lead the Department of Law until he picks a replacement.

Richards' departure, as well as that of Marty Rutherford, retiring from her role as acting commissioner of the Department of Natural Resources, comes while the state is working to push ahead its $55 billion natural gas pipeline project.

Chenault said the timing is bad for Alaska.

"It causes uncertainty and uncertainty is what undermines projects of this magnitude," the House speaker said. "You lose your state lead in DNR. You lose your attorney general, who's been involved. You've just hired a new president for AGDC (Alaska Gasline Development Corp.) Lots of uncertainty."

Richards earned $141,146 as attorney general, significantly less than the $200,000 to $500,000 a year he made in private practice, according to the range listed on his initial financial disclosure form in 2014.