The 49ers and Dallas Cowboys went to overtime Sunday for only the second time in their storied, 33-game rivalry.

As was the case in 1996, the 49ers lost on a field goal. But it wasn't just Dan Bailey's 19-yard field goal that gave the Cowboys a 27-24 comeback win before a bipartisan crowd of 69,732 at Candlestick Park.

The 49ers couldn't preserve a 10-point, fourth-quarter lead for several reasons, none of which Jim Harbaugh was eager to expose after his first defeat as 49ers coach.

"I'm not blaming anybody right now," Harbaugh said. "(The Cowboys) are a good football team. ... They dug themselves out of a hole and came back and won it."

Or the 49ers lost it. The 49ers secondary gave up big plays, Alex Smith got sacked six times, and mainstays Vernon Davis and Frank Gore were not happy campers.

Quarterback Tony Romo will reap a lot of credit for the Cowboys' comeback. He sat out three series after halftime with a fractured rib before returning once the 49ers took a 24-14 lead.

On his first snap of overtime, Romo faked a handoff that fooled safety Donte Whitner and allowed Jesse Holley to spring wide open for a 77-yard completion to the 49ers' 1-yard line. That's where Whitner caught up to Holley to save a touchdown, and merely delay defeat one more snap until Bailey's winning kick.

"We feel we had a really good opportunity to win this football game and let it slip through our hands," said Whitner, who made an end-zone interception on Jon Kitna's first series in place of Romo.

Several 49ers defenders acknowledged Romo's toughness for playing through the injury, which he believed occurred on his second pass of the game. Later in the first half a hit by blitzing cornerback Carlos Rogers made Romo visibly wince.

"I didn't want to be 0-2," Romo said of his motive for returning. "At the end of the day, it is about winning and losing, and we needed to win. Why I wanted to be out there? I am competitive. If I can play. I am going to play. There is no secret about that."

Added Harbaugh: "He made some really good plays there at the end. So did their receivers. So did their team."

The 49ers basically stopped making plays late in the third quarter, after Smith connected with tight end Delanie Walker for a 29-yard touchdown pass. That play gave them a 21-14 lead, and it came one play after Tramaine Brock intercepted a Kitna pass.

The 49ers stretched their lead to 24-14 on David Akers' 55-yard field goal, the longest in Candlestick history. But Harbaugh immediately faced one of his toughest coaching calls to date. He opted to decline a Cowboys penalty on that field goal, preferring to go up two scoring drives rather than resume that one.

On the Cowboys' ensuing series, Romo converted on fourth-and-5 and then found Miles Austin for a 25-yard touchdown pass. It was Austin's third TD catch of the game, and he beat safety Madieu Williams.

"I just overran the ball," Williams said. "The ball hung in the air a lot longer than I expected, and he made a big play."

A second-down sack by an untouched DeMarcus Ware foiled the 49ers' chances of running out the clock. The 49ers had taken over at their 20 with 6:55 remaining.

"I was probably just thinking about getting to the quarterback, because pressure is a big thing when it comes to Alex Smith," Ware said. "He gets the ball out so fast."

That sack was a prelude to the 49ers' offensive demise in overtime, which started promisingly enough with a 12-yard reception by Ted Ginn and a 7-yard run by Gore. But Jay Ratliff slipped past center Jonathan Goodwin and sacked Smith on second down. That led to an incompletion on third-and-11 and an Andy Lee punt.

"My mind goes back to the sack right there," Smith said. "Third and long makes it nearly impossible to move the chains."

The 49ers tallied only 67 yards after halftime, and they were outgained overall 472-206.

Gore had 20 carries for 47 yards, including a 1-yard touchdown run for a 7-0 lead. Kyle Williams' first NFL touchdown, on a 12-yard fade from Smith, upped the 49ers lead to 14-0.

Smith finished 16 of 24 for 179 yards, including only two completions for 18 yards to tight end Davis, who was surprised how often he stayed at the line to block Ware.

"I thought that I'd be out on the route, that I'd be running a lot of routes, especially because their secondary was banged up a bit," Davis said. "I thought we could take advantage of them in that aspect. But it's up to the coaches each week, decide what they want to do."

The 49ers won't be home for three weeks. Next up are road games at Cincinnati and Philadelphia. In between is a five-day layover in Youngstown, Ohio, home of team owners John and Denise DeBartolo York.

"It's a long season," linebacker Patrick Willis said. "We're not going to let this loss define who we are."