TURIN, Italy — Defender Medhi Benatia has signed a contract that will keep him at Juventus for three more seasons after the club exercised an option to purchase his full rights from Bayern Munich for 17 million euros ($18.5 million).

The 30-year-old Morocco captain had been playing for Juventus on a season-long loan.

"Since I arrived I've always expressed my desire to stay at Juventus and I hope our future is filled with successes," Benatia says.

Joining a stellar backline featuring the likes of Giorgio Chiellini, Andrea Barzagli and Leonardo Bonucci, Benatia has contributed to Juve's run to the Champions League final.

Juventus needs only to draw at second-placed Roma on Sunday to clinch a record sixth straight Serie A title.