SAN FRANCISCO -- They took wildly different paths, but the Giants and Dodgers are right back where they started.

The Giants, leaders of the division since April 25, nearly got no-hit by Cincinnati Reds right-hander Homer Bailey on Sunday and instead settled for a 4-0 shutout loss. The four-game sweep was the first by a visiting team in the 15-year history of AT&T Park. The Dodgers, preseason favorites and the most expensive team in MLB history, shut out the St. Louis Cardinals 6-0 behind scalding ace Clayton Kershaw.

On June 8, the Giants led the National League West by 91/2 games. Now the rivals are all tied up.

"It's going to be a race right to the end, it feels like," right-hander Tim Hudson said. "We've seen our worst days, hopefully. Hopefully they're behind us."

San Francisco Giants’s  Tim Hudson  (17) pitches against Cincinnati Reds  in the first inning at AT&T Park in San Francisco, Calif., on Sunday, June
San Francisco Giants's Tim Hudson (17) pitches against Cincinnati Reds in the first inning at AT&T Park in San Francisco, Calif., on Sunday, June 29, 2014. (Josie Lepe/Bay Area News Group) ( Josie Lepe )

Hudson was an Atlanta Brave on July 2 when the reeling Giants couldn't muster a hit against Bailey and lost for the 13th time in 17 games. This year's skid is even deeper. The Giants have lost 15 of 19, including 12 of their last 14 at home.

The losing already has cost one prominent Giant. Closer Sergio Romo was removed from the ninth-inning role Sunday morning, a day after he blew a third save in his last five tries. Romo is 0-3 with a 10.64 ERA in his last 12 appearances, so he was called into manager Bruce Bochy's office and told that Santiago Casilla and Jeremy Affeldt would form a closer committee.

"Sometimes you've got to change things," Bochy said. "Sometimes it's good for the player. Back him off and let him catch his breath."

Romo will pitch in the seventh and eighth for the time being. As he walked out of the clubhouse, he said he is a team guy and is on board with the decision.

"It is what it is," said the right-hander who threw the final pitch of the 2012 championship season. "I'm going to get a chance, and when I get a chance I'm going to be ready to rock."

If any of the Giants relievers are to get consistent shots to close, the lineup will need to pick it up. For the fourth time in five games the Giants got a strong outing from their starter -- this time Hudson -- giving the clubhouse hope that the staff has turned a corner. But now it's the lineup that's lost. The Giants have scored 12 runs in seven games on the homestand, the lone win coming when Tim Lincecum threw a no-hitter.

"I feel like we come in ready to win every day. It's just not happening right now," shortstop Brandon Crawford said. "It's frustrating. Buster (Posey) hit one (hard) and (Michael Morse) hit one the next inning and somehow we get to the seventh inning and we still don't have a hit. It's pretty frustrating, but that's the way it goes."

Posey's liner to left sent outfielder Skip Schumaker to the warning track three batters into the game, but Schumaker made a leaping catch. Morse hit one on the screws in the second, but right at Schumaker. For most of the rest of the afternoon, Bailey looked poised to join Lincecum as the only pitchers in the past 104 years to no-hit the same team twice.

Bailey allowed just a Gregor Blanco walk through the first six innings. With the Giants trailing 1-0 in the seventh, Posey rapped a two-out single to right to end Bailey's bid for a third career no-hitter. Pablo Sandoval's blooper fell among three Reds, but Morse struck out looking, ending the threat.

Bailey went the distance, giving up just three hits. The Giants scored six runs in the series while getting swept in a four-game home set for the first time since 1996. Back then they played at Candlestick Park.

"I will say, in this series we ran into four starters who were as dominant as any four starters I've ever seen," Bochy said. "But even before that, it's hard to explain these things. The only thing you can do, we've got to stay positive, be thankful for a good start. As bad as things are, we should consider ourselves fortunate for where we are at. That's the way we've got to look at it.

"It's really unbelievable. If you look at what's happened the last two weeks, you'd think we were 15 games back."

Bochy and others tried to find silver linings. The manager loves what he has seen from the pitching staff. Hudson, charged with two earned while pitching into the ninth, said the anticipated returns of Angel Pagan and Brandon Belt in the coming week should help. Hudson still believes that one electric win can turn around the slumping team.

"Somebody needs to pay," he said, smiling. "We need to beat the brakes off somebody one of these days. Maybe that'll get us going."

They had better hurry. Since April 25, the Giants had been alone atop the division for all but one day. Now, as Bochy said, they're back in a fight -- and it certainly appears that the Giants are outgunned. Maybe it's best then to hunker down and try to get healthy. Posey said the Giants aren't paying attention to the Dodgers.

"We've got enough stuff to worry about," he said.

For more on the Giants, see Alex Pavlovic's Giants Extra blog at blogs.mercurynews.com/Giants. Follow him on Twitter at twitter.com/AlexPavlovic.

TUESDAY'S GAME

St. Louis (Marco Gonzales 0-0) at Giants (Tim Lincecum 6-5), 7:15 p.m. CSNBA


BACK WHERE they STARTED

After up-and-down first halves, the rival Giants and Dodgers are tied for first place in the National League West. Here's a look at their month-by-month records:

Giants Month Dodgers
17-11 March/April 15-12
19-9 May 15-15
10-16 June 17-10
46-36 Total 47-37