"It has been one of my greatest privileges to lead the Department of Justice," Gonzales said in a brief statement, giving no reasons for his departure as of Sept. 17.
President Bush said from his ranch in Crawford, Texas, "After months of unfair treatment that has created a harmful distraction at the Justice Department, Judge Gonzales decided to submit his resignation and I have accepted his decision."
Solicitor General Paul Clement will temporarily take his place.
Gonzales faced tough congressional questioning over the firings of nine federal prosecutors late last year, with Senate Judiciary Committee Chairman Patrick Leahy, D-Vt., flatly saying in July," I don't trust you."
At the same hearing, committee ranking member Arlen Specter, R-Pa., raised the possibility of appointing a special prosecutor to investigate whether the attorneys were dismissed at the direction of the White House.
Gonzales also found himself repeatedly defending the National Security Agency's domestic wiretapping program aimed at tracking potential terrorists abroad, which raised privacy concerns.
Congress is on its August recess, but some reaction to the news began to trickle out early Monday morning.
"The attorney general has done the right thing and stepped down," Senate Judiciary Committee member Charles Schumer, D-N.Y. told CNN. "For the previous six months, the Justice Department has been virtually nonfunctional."
The Judiciary Committee will conduct confirmation hearings for Gonzales' replacement.
Presidential candidate and former Sen. John Edwards, D-N.C., noted that he had called for Gonzales' resignation since March 13, and said Monday, "Better late than never."
Meanwhile, the official who spoke to the Times said President Bush grudgingly accepted Gonzales' resignation.
"The unfair treatment that he's been on the receiving end of has been a distraction for the department," the official said.
Gonzales' decision follows the departure of longtime presidential adviser Karl Rove.