Fleetwood Town have named Preston North End head of youth Graham Alexander as their new manager.
The 41-year-old retired from playing at the end of last season after 1,024 professional appearances.
He will replace former boss Micky Mellon, who was sacked following the Highbury club's FA Cup exit to Aldershot on Saturday.
The Cod Army are seventh in League Two following their promotion from Blue Square Bet Premier last season.
The job will be Alexander's first permanent managerial role in professional football.
However, the Scotsman does have some previous experience, taking joint-caretaker charge of Preston alongside David Unsworth last season following the sacking of Phil Brown. The Deepdale club lost just one of his five games in charge.
During a playing career spanning 22 years, Alexander played 421 games in two spells for the Lilywhites.
The former Scotland international, who also featured for Scunthorpe, Luton and Burnley, retired from playing in April.
His first game in charge will be at home to fellow promotion-chasers Southend on Saturday.
Mellon's sacking came as a surprise after leading them to two promotions in charge.
In their first season in the Blue Square Bet Premier, they lost in the play-offs to AFC Wimbledon.
A year later the Scot guided the club to the Football League as champions and they also reached the FA Cup third round for the first time.
The Cod Army have spent the majority of this season in the top seven of League Two, but Pilley decided to take action after losing the past three games.