Pena's resignation came hours after the Royals fell to a major league-worst 8-25.
Royals spokesman Aaron Babcock said Pena would be replaced on an interim basis by bench coach Bob Schaefer.
Pena looked especially distraught after Kansas City's Angel Berroa committed a base-running blunder in the ninth.
With his team trailing 3-1, Berroa led off the inning with a double, but he was doubled off second base after Mike Sweeney flied out to center fielder Vernon Wells, whose throw to second beat a slowly retreating Berroa.
"I think he went too far and there was no reason for him to get into the double play when we're down two runs," Pena said hours before his resignation became public. "We had some chances today. You can't take anything away from Roy, he did a great job. He's one of the tougher pitchers in this league. We had some opportunities, but made a mistake and we paid for the mistake."
The Royals were one of baseball's biggest surprises in 2003, Pena's first full season. They went 83-79 and contended into September before finishing third in the AL Central, earning Pena manager of the year honors. It was the team's first winning season since 1994.
The Royals were expected to challenge for the division crown last season, but got off to a terrible start and traded star center fielder Carlos Beltran in June. They wound up losing a team-record 104 games.
Kansas City general manager Allard Baird said Pena will be offered a position within the organization.
The Royals failed again to produce for starter Zack Greinke (0-4), who allowed three runs and six hits in the first complete game of his career. Greinke has received just nine runs of support in his seven starts.
"The first inning looked like we were going to get a couple and things were looking good in the dugout, but it just didn't happen," Greinke said. "When you have Roy out there pitching, it's tough."
Shea Hillenbrand hit a two-run homer for the Blue Jays, who struggled before playing the Royals. Toronto has won two straight against Kansas City after losing their previous four games overall.
Halladay made quick work of the undisciplined Royals.
"I tried to get them to put the ball in play as early as I could," Halladay said. "We knew they have a lot of guys that swing early."
Halladay (5-2) allowed one run and eight hits, while striking out five and walking none for his 18th career complete game and his first since April 29, 2005, against the New York Yankees.
The 2003 AL Cy Young Award winner followed up a brilliant three-hitter in a win over Randy Johnson and the Yankees on April 29 with a lackluster effort in a 5-1 loss to Baltimore last Wednesday.
"Roy's a bulldog out there. You know he's going to come right at you with his power sinker and power cutter and big 12-to-6 curveball, that's why he won the Cy Young," Sweeney said. "He threw a complete game in an hour and 44 minutes. That's why he's one of the best."
Sweeney homered in the first inning, his seventh home run in his last nine games. He has 29 of Kansas City's 108 RBI (27 percent).
The homer came right after Halladay had thrown out Berroa after being struck on the hand by his comebacker. Halladay experienced some numbness, but didn't blame it for the homer.
"I just got away from my game plan," Halladay said. "I think that hurt me more than the thumb."
Sweeney compared Greinke to Halladay.
"The center of Toronto's pitching staff is Roy Halladay. Ours and our future is Zack Greinke. I think he showed baseball that he can pitch up here with the best," Sweeney said.
Hillenbrand hit a two-run homer off Greinke, his third of the season and his first since April 16, at Texas.
Toronto's Eric Hinske tripled in the second and scored on Ken Huckaby's RBI single.
|With his 18th career complete game, Roy Halladay improves to 5-2 with a 3.38 ERA. (AP)|
|Players of the Game|
|Kansas City Royals|
|David DeJesus, CF||3||0||1||0||0||0||1||.262|
|Angel Berroa, SS||4||0||1||0||0||1||2||.230|
|Mike Sweeney, 1B||4||1||1||1||0||1||0||.333|
|Matt Stairs, DH||4||0||2||0||0||1||0||.247|
|Terrence Long, LF||4||0||0||0||0||0||2||.200|
|Emil Brown, RF||3||0||1||0||0||1||1||.208|
|Mark Teahen, 3B||3||0||1||0||0||0||1||.250|
|John Buck, C||3||0||0||0||0||1||1||.163|
|Ruben Gotay, 2B||3||0||1||0||0||0||1||.200|
|2B - Angel Berroa (5, Halladay), Mark Teahen (2, Halladay)|
|HR - Mike Sweeney (9, Halladay)|
|SH - David DeJesus (4)|
|RBI - Mike Sweeney (29)|
|2-OUT RBI - Mike Sweeney (13)|
|Team LOB - 4|
|Outfield Assists - David DeJesus 1|
|Kansas City Royals|
|Zack Greinke (L,0-4)||8||6||3||3||2||2||1||3.38|
|Pitches-Strikes - Zack Greinke 96-61|
|Ground Balls-Fly Balls - Zack Greinke 7-14|
|Batters Faced - Zack Greinke 31|
|Toronto Blue Jays|
|Orlando Hudson, 2B||4||0||0||0||0||1||2||.270|
|Frank Catalanotto, LF||3||1||1||0||0||0||0||.286|
|Reed Johnson, LF||1||0||0||0||0||0||0||.309|
|Corey Koskie, DH||3||0||0||0||1||0||0||.252|
|Shea Hillenbrand, 3B||4||1||1||2||0||1||1||.356|
|Eric Hinske, 1B||3||1||2||0||0||0||0||.273|
|Vernon Wells, CF||3||0||0||0||0||0||2||.208|
|Alex Rios, RF||3||0||1||0||0||0||2||.289|
|Russ Adams, SS||2||0||0||0||1||0||0||.265|
|Ken Huckaby, C||3||0||1||1||0||0||0||.273|
|3B - Eric Hinske (1, Greinke)|
|HR - Shea Hillenbrand (3, Greinke)|
|RBI - Shea Hillenbrand 2 (13), Ken Huckaby (3)|
|2-OUT RBI - Ken Huckaby (1)|
|Team LOB - 4|
|Outfield Assists - Vernon Wells 1|
|DP - R. Adams-Hudson-Hinske, V. Wells-R. Adams|
|E - Roy Halladay (1, Wild throw)|
|Toronto Blue Jays|
|Roy Halladay (W,5-2)||9||8||1||1||0||5||1||3.38|
|Pitches-Strikes - Roy Halladay 97-63|
|Ground Balls-Fly Balls - Roy Halladay 13-6|
|Batters Faced - Roy Halladay 32|
|Attendance - 20123|
|Game Time - 1:44|
|Temperature - 68|
|Umpires - Home - Mike Winters, First Base - Tom Hallion, Second Base - Jerry Meals, Third Base - Hunter Wendelstedt|