Chief U.S. District Judge Vaughn Walker of San Francisco, who struck down California's Proposition 8, announced Wednesday he will retire from the court in February.
Walker also said he will step down as chief judge on Dec. 31.
In August, Walker overturned Proposition 8, the state's voter-approved ban on same-sex marriage, saying it violated the U.S. Constitution's guarantees of due process and equal protection.
The sponsors of the measure are now appealing that ruling to the 9th Circuit Court of Appeals.
Walker has also presided over a series of cases in which citizens sued telephone companies and the government over warrantless national security wiretapping.
Walker, 66, was appointed to the court by President George H.W. Bush in 1990 and was previously in private practice in San Francisco.
He said he plans to return to the private sector after leaving the bench.
Walker notified President Barack Obama of his decision in a letter Wednesday.
The court released a statement from the letter in which Walker wrote, "Concluding 21 years of judicial service, I leave the bench with the highest respect and regard for the federal judiciary, its judges and their staff and the essential role they fulfill in our constitutional system."
Walker became chief judge of the U.S. District Court for Northern California in 2004. Under federal law, chief judges are selected on the basis of a combination of age, seniority and experience and may serve for seven years.
The new chief judge will be U.S. District Judge James Ware of San Jose.