"I can't take it any more," Pena said.
Pena informed general manager Allard Baird of the decision after the Royals' loss to the Blue Jays at Toronto.
"He was stunned," Pena said.
The Royals (8-25) are in last place in the American League Central.
"I've been thinking about it for the last three weeks," Pena said from Toronto. "It made me sick. I wasn't eating well or sleeping well because I thought so much about the way we played. I don't think we've played to the top of our ability."
Early Wednesday morning, the Royals announced that bench coach Bob Schaefer will manage the club on an interim basis until Pena's permanent replacement is found.
Frank White, a popular figure in Kansas City, is sure to enter into speculation about Pena's successor. White, a starting second baseman and a member of the Royals Hall of Fame, is in his second season of managing their Double-A club at Wichita.
"We will take as long as we need to hire a new manager," Baird said.
Baird, on the current road trip with the club, said he was indeed surprised by Pena's decision. The two met shortly after the Royals' 3-1 loss which made them 3-8 on the trip with a game remaining Wednesday afternoon in Toronto.
"He didn't feel comfortable with the way the team has been playing," Baird said.
The Royals launched a youth movement this season but, after a 3-3 start, the team has lost 22 of 27 games.
Baird said that Pena will remain in the Royals' organization in a position to be determined. His contract as manager ran through the 2006 season.
"I'll stay around and help out in any aspect they want me to help," Pena said.
Pena was the American League Manager of the Year in 2003 after leading the Royals to a turnaround season in which they led the division for more than 90 days and finished third.
But last season the team plummeted to 104 losses and last place.
"I don't want this to tarnish what he's done in the past for this organization like he did two years ago, as well as being a very large part of a lot of our young players' development," Baird said.
"His willingness to take on young guys, put them in situations and believe in them and send them back out there is a good application in theory but it's not always easily done. But he did it very well."
This was Pena's first Major League managing job. His record with Kansas City was 198-285. He was bench coach for the Houston Astros when he was named Royals manager on May 15, 2002, after Tony Muser was dismissed.
Tony Pena's managerial record
After resigning, Pena said the Royals' youth movement was the right direction for the club and he believed that, if that approach continues, they will be "contenders for a long time." He also had praise for those in the organization, Royals fans, team owner David Glass and president Dan Glass.
"They deserved better," Pena said.
There have been recent media reports that Pena has been subpoenaed to testify as a witness in a civil case, a report he confirmed but on which he declined to elaborate. Baird said the case had nothing to do with the ballclub and Pena said it had no bearing on his decision.
"No, that had nothing to do with it," Pena said.
The Royals this season had difficulty scoring -- they lost nine games by one run and four by two runs -- and team captain Mike Sweeney was their only consistent offense force.
Their pitching staff revolved around veteran Jose Lima and young guns Zack Greinke, Runelvys Hernandez and Denny Bautista. The kids showed promise but they lacked run support, notably Greinke. The bullpen currently has rookies Andrew Sisco and Ambiorix Burgos as setup man and closer, respectively.
Until the recent seven-game errorless streak, the defense was surprisingly porous and fundamental mistakes often plagued the Royals.
Pena said he had no dissatisfaction with the attitude of his players.
"No, no, no. They gave me everything they had," he said. "No question, they played hard to me. They played very hard for me."
Known for his smiling, upbeat attitude, Pena tried to be a confidence-builder with his young club right up to the end. He was a hands-on manager, often whisking through the clubhouse to exchange pleasantries and jokes with his players. He took personal charge of pregame workouts in an effort to smooth out the team's performance.
However, loss after loss had to be chewing him up inside. After a loss last Wednesday night to the White Sox in Chicago, Pena closed the clubhouse and gave his players a tongue-lashing that could be heard through the vibrating doors.
Finally, on Tuesday night, he'd had enough.
"Just right now I couldn't take it any more -- losing every night, it hurts," he said.
Dick Kaegel is a reporter for MLB.com. This story was not subject to the approval of Major League Baseball or its clubs.