The Cobblers were expected to challenge for promotion from npower League Two this season, but equalled a club record of six straight draws at Southend last weekend before the defeat at Sixfields on Tuesday night which left them in 16th place in the table.
Former central defender Sampson, 42, joined the club in 1994 and racked up over 400 appearances for the club before joining the coaching staff on retirement.
He was handed the top job in October 2009 after a spell in caretaker charge but has failed to lead the club into the play-off places.
Chairman David Cardoza said: "The club must always come first but that doesn't make this decision any easier.
"I, my fellow directors, the staff and supporters all wanted Ian to succeed.
"I really hoped Ian would prove a successful manager here, but I did not see enough signs that we were improving as a side.
"Ian had put together a decent squad, and in a way that made our league position all the more unacceptable, and we are at a crucial time of year.
"I wanted to make this change now to give us time to go through a detailed recruitment process and to give the new man time to assess the squad before the end of the season, to look at the budget for next season and have a full summer to recruit and make the changes they see fit."
Assistant manager Malcolm Crosby has been placed in temporary charge.
Source: PA
Source: PA