McIlroy, 56, had been in charge of the Shrimps since 2005, initially in a caretaker role before he was handed the reins on a permanent basis.
In his first full season, McIlroy guided Morecambe into the Football League for the first time in their history with a 2-1 win over Exeter in the 2007 Conference play-off final at Wembley.
Last season saw the Lancashire outfit reach the League Two play-offs but they have failed to build on that progress and chairman Peter McGuigan said: "Sammy and Mark steered the club into the Football League and led us to a play-off spot last season which was a fantastic achievement.
"This season has been disappointing but everyone at the club will always recognise the fantastic contribution they both made to its success and we thank them for all their hard work and commitment."
McIlroy, who had previously managed Norwich Victoria, Macclesfield, Stockport and Northern Ireland, said: "We spoke about a new deal but I just thought it was better for me and for the club that I looked for a new challenge and the club brought in a fresh face."
Source: PA
Source: PA