"It was already gone and passed and it happened so fast," Barney said. "It's exciting. It was good for our club."
Barney's pop and the speed of Tony Campana -- who stole two bases and scored the tying run in the eighth -- gave the Cubs their first sweep of the season. The victory is also a season-high third straight, coming on the heels of a 12-game losing streak.
According to STATS, Inc., the Cubs are the first National League team to win at least three in a row following a streak of 12-or-more losses since August 2002, when the Mets also followed a 12-game skid with three straight.
"We had a tough stretch for a while, so to get back into the winning ways is nice," Campana said.
First baseman Bryan LaHair hit a leadoff single in the ninth before Barney's homer sailed into the wind in left-center.
"That ball was crushed," Cubs manager Dale Sveum said.
Barney's heroics were made possible by Campana, who proved his speed is just as potent of a weapon as power.
Campana pinch-ran for Reed Johnson -- who had hit a pinch-hit, two-out single in the eighth -- and stole second, even with the Padres calling for a pitchout.
"Reed did the hard part. He got a hit against guy like [Padres reliever Andrew] Cashner, that ain't easy to do," Campana said. "He's pretty slow to the plate. All I have to do is run."
Campana did just that again, this time swiping third before scoring on an infield single by Starlin Castro, who dove safely into first base.
"It's one of those players where I was playing him in the hole to take away a cheap ground ball," Padres third baseman Chase Headley said. "It's tough. You have to make a decision. I thought my best chance was to get that big hop. He's not a slow guy. Looking back, maybe I try a do-or-die play there. I don't know."
With the Cubs struggling to score runs during their losing streak, Campana has been relegated to the bench as Sveum searches to add power to his lineup. Prior to Wednesday's game, the manager said Campana could be a dangerous weapon off the bench.
The speedster proved him right in the eighth.
"He's a huge, monster asset to be able to use in those situations. He's so fast," Sveum said. "When you're losing by one run, you don't want to leave him on the bench. When anybody gets on base, you have to get him in there, even if there are two outs."
Barney and Campana gave the Cubs the win after right-hander Ryan Dempster allowed a trio of two-run home runs -- two off the bat of Carlos Quentin -- while lasting only 4 1/3 innings.
Quentin, who made his season debut in Monday's series opener, was 7-for-12 with three doubles, four home runs and six RBIs in the series.
Dempster's no-decision keeps the right-hander winless since Aug. 11 of last season, a span of 18 starts. He is the first Cubs starter to go 18 consecutive starts without a victory since Danny Jackson from 1991-92, according to STATS LLC.
"I really don't care about [my record] today," said Dempster, who has a 3.95 ERA in that span. "Just the fact we did such a great job and battle all the way back and have a huge win like that is awesome."
Four members of the Cubs bullpen held the Padres to three hits in 4 2/3 shutout innings before Barney and Campana led the Cubs back.
"Sometimes when you play games like this, everybody sees the walk-off home run and you lose focus on what got us there," Dempster said. "What got us there was the bullpen doing its job."
Dempster did post a season-first in the second inning, however, getting his first hit of the year. Dempster, an .097 career hitter, singled into center to score catcher Steve Clevenger, who drove in the Cubs' first run with a single of his own.
Clevenger, in his first action since being reinstated from the disabled list Tuesday, also added an RBI double in the fourth.
After an off-day Thursday, the Cubs begin a 10-game road trip with a four-game series in San Francisco. Barney and the Cubs are hoping his blast and the series sweep is the momentum the club needs to put together a good road trip.
"It's nice to win three in a row. If we can build on it, that's what we're trying to do," Barney said. "There's a lot of season left and who's to say we can't turn this thing around?"