KANSAS CITY, Mo. (AP) -- Rafael Palmeiro knew his slump wasn't going to last.
The 40-year-old Palmeiro was 7-for-40 in his previous 14 games, dropping his average to .222. He had just three home runs and 10 RBI in his first 37 games.
"I've always been a good hitter. I knew eventually I'll figure it out," Palmeiro said. "Tonight everything just felt good. I've been pretty decent the last few weeks, but tonight everything fell right in place."
Palmeiro had nine home runs and 23 RBI the final month of last season.
"The power has always been there over the last 15 years. It has never gone away," he said. "If my mechanics are right and my rhythm is right, I'm going to hit. It's that simple.
"Mechanically, I haven't been right. I was right in September of last year, but for some reason it didn't carry over into this year. It's not too late. There's a whole season ahead of us. There's no doubt in my mind I'm going to contribute and I'm going to hit," he said.
Brian Roberts added his 11th home run and Sal Fasano had a pinch-hit shot for the Orioles (25-13), who moved 12 games over .500 for the first time since the end of the 1997 season. Jay Gibbons also homered and drove in three runs.
Palmeiro had his first four-hit game since Sept. 28, 2001. His homer leading off the Orioles' six-run fourth was his 41st against the Royals, the most by any player.
"The key is we were able to win the game after falling behind," Palmeiro said. "It's not going to happen every time, but at least the feeling is there in the dugout that we can come back and score."
Five Orioles relievers combined to hold the Royals scoreless on four hits for 7 2/3 innings. B.J. Ryan finished for his 11th save in 12 chances.
"The bullpen weathered the storm and we stopped the bleeding," Orioles manager Lee Mazzilli said. "You've got to try to swing the momentum. This team thinks they can come back every time and do it. In reality, it doesn't happen every time, but they think so."
The Royals were trying to win three straight for the first time since July 11-16, 2004.
Orioles starter Sidney Ponson left after only 1 1/3 innings with a bruised left calf after being struck by Matt Stairs' liner and was replaced by John Parrish. Ponson was charged with eight runs -- six earned -- and eight hits.
The Royals batted around in a five-run first, then increased their lead to 8-2 in the second by scoring on Ponson's throwing error, a bases-loaded walk by Parrish and Parrish's wild pitch.
Parrish (1-0), who struck out four and walked three in 1 2/3 innings, was credited with the victory.
Royals starter Jose Lima remained winless in 11 starts since last Sept. 14 for the Dodgers. He lasted just three-plus innings, allowing seven runs and four hits, including home runs by Roberts,
Gibbons and Palmeiro.
"He can't make a mistake without the ball going out of the park," Royals interim manager Bob Schaefer said. "I don't know what he's throwing, but when the ball is up it goes a long way."
Lima, whose ERA soared to 7.77, has yielded an American League-high 12 home runs. He left after Gibbon's two-run shot brought the Orioles within 8-7 and was replaced by Jaime Cerda
(1-3), who gave up Melvin Mora's double to tie the score and Palmeiro's go-ahead single.
"This is embarrassing," Lima said. "To give up seven runs, I blew it. We score eight runs and I can't hold it. This is not the Jose Lima I know."
The Kauffman Stadium crowd booed Lima when Schaefer pulled him.
"This is the first time in my career I get booed at home," Lima said. "Every outing I have one bad inning, giving up four or five runs. I always try to stay away from the big inning."
The Orioles padded their lead with two runs in the seventh. Palmeiro had an RBI single, stole second and scored on Gibbons' double.
Orioles DH B.J. Surhoff was ejected in the seventh by plate umpire Gary Darling for arguing a called third strike. ... Royals center fielder David DeJesus was held out of the lineup with a foot injury. Eli Marrero replaced him in center. ... The Orioles acquired infielder Mike Moriarty from the Chicago Cubs for future considerations and assigned him to Triple-A Ottawa. He played eight games in 2002 for Baltimore, going 3-for-16.