SANTA CLARA, California — Nick Foles and one of the NFL's best offenses needed a touchdown to preserve Philadelphia's unbeaten record on a day its defense and special teams more than did their parts.
But Foles threw incomplete on back-to-back passes from the 1-yard line after the two-minute warning, and he was intercepted on a final, last-ditch drive as the Eagles lost 26-21 to the San Francisco 49ers on Sunday.
"We just didn't execute — it's as simple as that," Foles said. "I'm not going to break it down or anything. In that situation, I have to give the guys an opportunity to make a play, and I didn't do that."
Darren Sproles had a career-best 82-yard punt return for a touchdown and Malcolm Jenkins ran an interception 53 yards for a score for the Eagles (3-1). Brad Smith recovered Trey Burton's blocked punt of Andy Lee for a TD.
Those plays were for naught.
"When you get a defensive score, the chances of you winning the game skyrockets," Jenkins said. "If we talk about those three scores on defense and special teams, statistically 100 percent of the time that team is going to win. But playing on the road against a team like that, we just needed one more play, and we didn't get it."
Foles put the Eagles in position to potentially take the lead when he led them on a 90-yard drive. On third-and-14, he completed a 22-yard pass to a diving Jeremy Maclin on the right sideline. The 49ers challenged whether Maclin had possession, but the play stood, costing the 49ers their final timeout.
But the Eagles couldn't pull off the second-half magic that had carried them in their three wins, and the drive ended a yard short of the end zone.
LeSean McCoy was limited to 17 yards on 10 carries, with his longest run just 5 yards.
"There are going to be days when two of your phases are playing well and you just hope they can bail out the other one," Kelly said. "We just didn't play well enough on offense. Offensively, we didn't do anything."
Colin Kaepernick threw an off-balance 55-yard touchdown pass to Frank Gore and also connected with Stevie Johnson. Phil Dawson kicked four field goals — two of at least 46 yards. Kaepernick finished 17 for 30 for 218 yards, two TDs and four sacks.
"I don't think I've ever had one quite like that," Kaepernick said. "It was a great job by Frank."
But on San Francisco's next series, Kaepernick threw right to Jenkins, and the safety broke three tackles on the way to the end zone.
The 49ers won their first game at new Levi's Stadium, where thousands of fans skipped out at halftime.
San Francisco outgained the Eagles 232-73 in the first half, but still trailed 21-13. Then Johnson tiptoed both feet inbounds inside the left pylon in the third quarter for a 12-yard catch.
Foles, who led the NFL in passer rating a year ago, was 21 for 43 for 195 yards and two interceptions.
NOTES: Foles missed a chance to join Peyton Manning, Steve Young, Kurt Warner and Drew Brees as the only QBs to open the season with four straight 300-yard passing games. ... The Eagles scored twice on special teams for the first time since Nov. 22, 1992, at the New York Giants. It was the first time they scored on special teams in consecutive games since 2000.