The Daniels had looked on course for victory in the Southern League Premier Division Central clash when two first half goals from James Blunden, both courtesy of Connor Bartle assists, put them in the ascendency.
However, two goals in four second half minutes from Leon Lobjoit brought Bedford back onto level terms before the in-form frontman netted a stoppage time winner to secure victory on their first ever visit to the Zeeco Stadium. Manager Graham Drury made three changes to his Stamford starting line-up following last week's FA Trophy defeat at home to Anstey Nomads.
Charlie Marzano, Bartle and Will Glennon all came into the team with Billy Bennett and Tobias Liversidge both on the bench while striker Jack Duffy was suspended. The Eagles arrived on the back of a six-match unbeaten league run but, like the Daniels, had suffered a 5-1 home reversal in the FA Trophy last weekend.
Bedford started the brighter of the two teams but, once Stamford had weathered an early spell of pressure, they dominated the opening half. Bartle swung and miss-hit a decent opening after being played in by Harry Vince while a cross-shot from Joe Burgess drifted just past the far post.
New signing Richard Gregory then rattled the Bedford crossbar after Rob Morgan and Marzano had combined well down the right to create the chance. Tendai Chitiza had worked tirelessly in the Stamford attack, and it needed a fine last-ditch tackle from Lewis Green to deny the Daniels frontman after he broke clear.
Chitiza was then foiled by a point-blank range save from Ollie Bosworth after a near post header from a Bartle corner. Bartle's return had boosted Stamford for their set pieces and long throws, and it was from a 29th minute corner that the Daniels took the lead.
His in-swinging corner was met at the back post by Blunden for the first of two goals from the centre-half in nine first half minutes. The Daniels then doubled their lead in the 38th minute with another Blunden header from an inch-perfect Bartle delivery.
It gave Stamford control of the contest going into the interval with Bedford making three changes as the teams returned for the second period. Home goalkeeper Tom Jackson was forced into a smart early stop to keep out a Ryan Blake effort before Bedford equalised in the 50th minute as top scorer Lobjoit slotted his finish into the bottom corner of the Stamford net.
The momentum was now with the visitors and, after Blake had seen an audacious back-heel go just wide, they equalised. Lobjoit picked the ball up out wide before curling a superb cross-shot into the far corner of the home net.
Stamford looked for a response and Morgan flashed a header just wide with Jackson getting down swiftly at the other end to hold onto a similar effort from Coker. The Daniels custodian then excelled to not only keep out but also hold onto a goalbound shot from Blake after the Bedford attacker had weaved past a couple of challenges to create the opening.
Jackson though was powerless to prevent Bedford from grabbing their late winner as Lobjoit converted at the back post from Rob Hall's in swinging free kick as Stamford slipped to their first home league defeat of the season.