Barcelona will try to end one of the worst crises in club history with Ronald Koeman as its coach.

Barcelona officially announced a deal with Koeman on Wednesday, a day after club president Josep Bartomeu had said the Dutchman accepted the coaching offer and only details needed to be sorted out.

The official announcement comes five days after the team’s humiliating 8-2 loss to Bayern Munich in the Champions League quarterfinals.

Barcelona said the former defender's deal runs through June 2022.

Koeman replaces the fired Quique Setién.

More AP soccer https://apnews.com/Soccer and https://twitter.com/AP_Sports