The striker netted eight goals in 23 league games during his loan spell at Edgeley Park this season.
Donnelly becomes the second player to be signed by Fleetwood in January, following Sean Gregan to the club.
Gregan joined the Blue Square Bet Premier side on a free transfer from Oldham Athletic on Thursday.
Fleetwood are currently fifth in the league standings, having won their last two games.
Source: BBC Sport
Source: BBC Sport