Raleigh, N.C. — John W. Smith, who has headed the state's Administrative Office of the Courts for six years and who has been the target of recent criticism by Republican lawmakers over same-sex marriage, announced Monday that he is retiring.

"Judge Smith has navigated our courts through some of the most challenging economic times in our state's history," Supreme Court Chief Justice Mark Martin said in a statement. "We can all be grateful for his steady leadership, dedicated service and commitment to the administration of justice in North Carolina."

Last fall, when some state magistrates balked at presiding over same-sex weddings after federal courts struck down North Carolina's constitutional ban on gay marriage, Smith issued a memo warning them they could be suspended or fined if they didn't fulfill the duties of their office.

Senate President Pro Tem Phil Berger blasted Smith's stance, saying accommodations should be made for magistrates whose religious beliefs don't include the concept of same-sex marriage. Berger quickly filed legislation to that effect when the General Assembly convened in January, and the bill is now pending in the House after passing the Senate last week.

Smith also has had to manage an increasingly clogged state court system with a diminishing budget. Funding to the court system, through both state appropriations and fines and fees charged in cases, has dropped by 40 percent in recent years.

It was unclear Monday whether the gay marriage dispute or state funding concerns played any role in his retirement, which takes effect May 1.

"It has been an honor to serve the North Carolina Judicial Branch and Administrative Office of the Courts," Smith said in a statement. "We have one of the finest court systems in the country, and I am humbled to have been a part of it."

Smith has served the state's courts for more than four decades, starting as a prosecutor in New Hanover and Pender counties in 1974. He later was on the bench as a juvenile court judge, District Court judge and special Superior Court judge before being names as AOC director in 2009.