Updated

All the Chicago Cubs could do was give credit to A.J. Burnett. Considering he nearly pitched a no-hitter against them, what choice was there?

Burnett threw a one-hitter, Neil Walker drove in five runs and the Pittsburgh Pirates beat Chicago 5-0 on Tuesday night, hours after the Cubs traded ace Ryan Dempster.

"I think it's just a case of Burnett's had a heck of a year, and he nullified our lineup," Cubs manager Dale Sveum said.

Burnett just about stole the spotlight after the Cubs traded their best pitcher to Texas just before the non-waiver deadline. His bid for a second career no-hitter and the sixth in the majors this season ended with two outs in the eighth.

He had already hit Darwin Barney in the helmet with one out before striking out Luis Valbuena, but his no-hit bid ended at the hands of a rookie when pinch-hitter Adrian Cardenas lined a 3-2 pitch to right for a single after two close pitches were called balls.

Burnett said he was angry about a 2-2 curve that just missed outside, and he appeared to be yelling at the umpire after the hit. But he struck out David DeJesus with runners on first and third to end the inning. That's probably not much consolation for the veteran, who pitched a wild no-hitter for the Marlins against San Diego on May 12, 2001.

He walked nine in that game, two in this one while striking out eight.

That a Miami-area native, who was 13-years-old back then, broke it up was a bit of an ironic twist. Not since Sandy Koufax did it to them in September 1965 have the Cubs been no-hit, and the last no-hitter at Wrigley Field came when Milt Pappas pitched one for Chicago against San Diego in September 1972.

""Great at-bat by Cardenas to come off the bench and get the count to 3-2 in his favor," Sveum said. "(Burnett) gave him a fastball and (he) put a nice swing on the ball."

Burnett's curve was as sharp as it's ever been, and he just missed the eighth no-hitter in franchise history.

"I thought he had a shot," manager Clint Hurdle said. "He was just so efficient, pinpoint command. He pitched the left-handers so extremely well tonight. Fastball gloveside, his curveball was sharp for strikes, for chase. Great tempo — 25 out of 31 first-pitch strikes. The pitch count was in a great place. That's one of the best games I've seen pitched ever."

He retired the first 11 batters before walking Anthony Rizzo, and as the game wore on, the sense that something special was happening filled the old ballpark.

There was a loud gasp when Alfonso Soriano sent a drive to deep left-center in the seventh that Andrew McCutchen caught, and first baseman Garrett Jones then made a sliding stop on Bryan LaHair's grounder to end the inning.

The Cubs got some relief when Cardenas finally broke through, but even that was tempered by the reality that they got shut down.

Cardenas faced Burnett in late May and didn't do so well, going 0-for-3 with two errors in a 1-0 loss.

"I remember him and seeing how he was working throughout that game," he said. "When I was able to get that hit, it was great but it was very short-lived because we lost 5-0. ... It's definitely sweet to break up the no-hitter here at our place. That's something you don't want to be a part of."

While Burnett cruised along, Casey Coleman had a rough night after being recalled from the minors. Pitching in Dempster's place, he lasted just 4 2-3 innings, allowing four runs and seven hits.

Walker quickly put the Cubs ahead in the first when he drove a 2-1 pitch to right for a grand slam — the second of his career and second at Wrigley Field.

He also had a sacrifice fly in the seventh.

Burnett's performance overshadowed the big news before the game, with Dempster going to the Rangers for two prospects.

The Pirates were a busy bunch, too. They acquired former All-Star first baseman Gaby Sanchez from Florida and sent third baseman Casey McGehee to the Yankees for reliever Chad Qualls.

Notes: Along with Coleman, the Cubs also recalled Cardenas and C Welington Castillo from Triple-A Iowa before the game. ... GM Jed Hoyer said it might not be long before Josh Vitters is called up from Triple-A. He was batting .298 with 15 homers. ... In the Sanchez deal, Pittsburgh also got minor league pitcher Kyle Kaminska for minor league outfielder Gorkys Hernandez and the extra draft pick for 2013 that the Pirates won in the competitive balance lottery for financially weaker teams. ... The Pirates recalled RHP Daniel McCutchen from Triple-A Indianapolis to take Brad Lincoln's spot in the bullpen. Lincoln was dealt to Toronto for Travis Snider on Monday.