Coach Stephen Robinson, who only recently returned to the club after a spell in charge of Oldham, will take temporary charge. He will be assisted by James McFadden and Stephen Craigan.
McGhee, who is also assistant to Gordon Strachan in the Scotland national squad set-up, leaves Fir Park with three months left remaining on his contract.
The veteran boss was recruited in October 2015 to turn around Motherwell’s fortunes after a dismal start to the season under Ian Baraclough. He helped stabilise the team and would eventually help them reach the top six.
However, the sale of Marvin Johnson to Oxford United last summer was a major blow and Motherwell have found themselves embroiled in a relegation battle throughout this season.
Saturday’s defeat to Dundee came just ten days after a similarly humbling loss at Pittodrie, where Motherwell were thumped 7-2 and McGhee was sent to the stands. After his ordering off, he remonstrated with Aberdeen fans and later accused the fourth official of having an agenda against his club.
Motherwell have won only once in their last eight games, including a Scottish Cup exit to Rangers, and have lost four straight in the league.
The Fir Park board will now look at candidates to replace McGhee, who exits the club for a second time having managed Motherwell between 2007 and 2009.
A Motherwell statement read: “The decision, taken by the board following consultation with the ‘Well Society, comes after a disappointing run of results, culminating in Saturday’s loss at home to Dundee.
“Stephen Robinson, flanked by assistant James McFadden and Under 20s boss Stephen Craigan, has agreed to take temporary charge whilst a new permanent manager is recruited as swiftly as possible.
“The club wishes to thank Mark for his work during his second spell at Fir Park, particularly getting the club into the top-six during the 2015/16 season and wish him every success in the future.”