Steve Clifford will be the new head coach of the Orlando Magic, the team announced Wednesday.

Clifford, who spent the past five seasons as coach of the Charlotte Hornets, agreed to a four-year deal, league sources told ESPN on Wednesday. He was an assistant coach with the Magic under Stan Van Gundy for five years, including the team's most recent playoff run in 2012.

"I've had 18 great years in this league and I've enjoyed every year, but none more than the five years here," Clifford said.

Magic president Jeff Weltman said the team used a "deliberate approach" and took its time, but insisted that the franchise made the right hire.

"We are very excited to welcome Steve back into the Magic family," Weltman said. "Steve is widely regarded throughout the NBA community as an elite coach and developer of players at all stages. His teams have always been disciplined and prepared, and have embraced the concept of playing for each other."

Clifford, 56, flew to Michigan on Tuesday to meet with ownership from the DeVos family.

Weltman considered Clifford the right combination of tactical coach, teacher and disciplinarian for a young, developing roster.

Clifford, who was fired by the Hornets in April, takes over a more talented roster than he inherited in Charlotte five years ago. The Magic's young core includes Jonathan Isaac and Aaron Gordon.

"The old saying in the NBA, and it's so true, is you never know a player until you coach them," Clifford said. "I'm going to start to try and establish the right kind of relationships with these guys tomorrow, or tonight. I want to be able to impact each one of these guys in the right way."

Weltman has been determined to find a coach with staying power, especially for a Magic franchise that has now employed five coaches over the past seven years. Weltman and Magic general manager John Hammond inherited Frank Vogel as coach upon their hiring a year ago and fired him at the end of Orlando's 25-57 season. The Magic have had six straight losing seasons, never finishing higher than 11th in the Eastern Conference.

"I think it's crucial," Weltman said. "Fifth coach in seven years, it's very important that we start to establish our identity and be able to build on something that doesn't get turned over every season."

Weltman and Hammond interviewed Clifford as members of the Milwaukee Bucks' front office five years ago and were eager to move ahead with him before Charlotte offered its job to him.

Clifford missed 21 games because of sleep deprivation and severe headaches during the 2017-18 season, but he has recovered. Orlando's doctors are confident that Clifford remains fortified for the grind of full-time NBA coaching again.

Charlotte made the playoffs twice under Clifford, including a 22-game improvement in his first year.

Clifford was 196-214 with the Hornets, including consecutive 36-46 campaigns in his final two seasons.

The Associated Press contributed to this report.