York City midfielder Patrick McLaughlin scored at both ends as they beat Oxford to end United's 100% start to the League Two season.
City led after 15 seconds when Ryan Clarke failed to deal with McLaughlin's shot and Michael Coulson tapped home.
U's striker Deane Smalley had a penalty saved by Michael Ingham before Ashley Chambers made it 2-0 from 16 yards out.
McLaughlin deflected Adam Chapman's corner into his own net, before making amends after Michael Raynes' error.
The result, York's first home win in the Football League since January 2004, knocked Oxford off top spot in the table.
VIEWS FROM THE DRESSING ROOM
York City manager Gary Mills told BBC Radio York:
"We're here to entertain, we're here to try and win football matches, we're here to enjoy it.
"We were 1-0 up and then obviously a penalty (for them) and a great save from Ingham. He's pulled off a couple of great saves in the first half which enabled us to go on and win the game.
"I'm delighted. I've said I thought the first game (of the season) flattered Wycombe.
"It was a weird day for us and since then we've shown what we've got with seven points in the last three games."
Oxford United manager Chris Wilder told BBC Radio Oxford:
"We should have got three points, without a shadow of doubt. We beat ourselves.
"We conceded three really poor goals and the timing of the first one was ridiculous.
"We'll look at this and wonder how we have not won. We haven't won because we've gifted three really poor goals to the opposition.
"We've had 17 crosses in the first half but haven't picked out the right run to score."