Hearts have finally completed a deal to appoint Daniel Stendel as their new manager.
The German has signed a two-and-a-half-year contract and will start work on Tuesday.
The former Hannover and Barnsley manager's appointment had been held up after the Yorkshire club demanded compensation despite removing him from his post two months ago.
The 45-year-old led Barnsley to promotion from Sky Bet League One last season but paid the price for winning only one of their first 11 Championship matches.
A deal was confirmed about an hour after Hearts fell to a 1-0 defeat against Motherwell in Austin MacPhee's sixth match in interim charge, which saw them slip to 10th place in the Ladbrokes Premiership, level on points with Hamilton and bottom club St Johnstone.
A club statement read: "While it has taken some time for this process to reach its conclusion we firmly believe that Daniel is the right man to take the club forward.
"With our number one target now on board and his future pledged to Hearts, everyone at Tynecastle Park welcomes Daniel and hopes his appointment heralds an exciting new era for the club as, together, we look to climb back up the Ladbrokes Premiership table."
MacPhee suffered four defeats and won one game after temporarily stepping up following Craig Levein's sacking and admitted it had been a difficult role.
"You are managing with one hand behind your back," he said after the Fir Park defeat. "You need to finesse the situation and manage the situation. You are not the ultimate authority and you need to manage relationships and I've managed to do that.
"In these situations everybody needs to look at yourself and when there is uncertainty it can maybe be an excuse in any business when the boss is off. I mind at school when a supply teacher came in when your teacher was off – a free-for-all.
"It wasn't like that but you have to be sensitive to the situation and keep everybody on track.
"I'm sure whoever comes will have their own ideas and some of the players will see it as a fresh start."
MacPhee, who was assistant under Ian Cathro and Levein, will now discover his own fate with Stendel expected to bring in his own backroom staff.
MacPhee had declared his interest in the job himself as well as the club's new sporting director position, which owner Ann Budge is looking to fill.
"When the dust settles, Mrs Budge and the new manager will probably decide where if anywhere my skills will be used to help the club," he said. "That's the reality of football. We will see what happens next week."