The 48-year-old took had been in charge of Posh since replacing Dave Robertson in September and lifted the club as high as the play-off places in January.
But they have since fallen to 14th in the table and have lost four of their last five matches.
Assistant Grant McCann will take charge for the final two games of the season.
Westley was asked by BBC Radio Cambridgeshire if he felt increased pressure following Saturday's defeat and said: "I come to work every day and feel pressure, I put pressure on myself.
"I don't like losing football matches, but I know the job here. The job is to build long-term winning.
"Right now the job is to get our young players on the pitch, to give them a chance to succeed and to grow, and that's what we've done (against Scunthorpe).
"There'll be lessons learned by all of the players, and if we're going to be a successful club next year, then we need the young players to step up to the plate and the experience now will be useful for them."
The former Stevenage and Preston boss began his career at the ABAX Stadium with 10 wins from his first 14 matches in all competitions.
However, after losing to West Brom in a FA Cup fourth-round replay on penalties and the January sale of forward Conor Washington, still the club's top scorer this season with 15, Posh lost six of their next seven league matches.
After a brief run of three straight victories, the club's form dipped again, leading chairman Darragh MacAnthony to say "I employ over 300 people at Peterborough United, not one of those employees right now has a job in the summer".
Earlier this week, Westley also bemoaned his side's poor discipline - the worst record in the Football League with 104 yellow cards and seven reds - saying it was costing them games.
A brief statement on the Peterborough website read: "The club would like to thank Graham for his efforts on behalf of the football club.
"Chairman Darragh MacAnthony will take time to speak to prospective candidates for the vacant manager position."
League One side Peterborough United have parted company with manager Graham Westley following Saturday's 2-0 defeat by Scunthorpe United.