The Swiss player broke Hanescu twice in the first set and held serve despite landing only 40 percent of his first serves and double-faulting twice.
Wawrinka's service improved in the second set as he made 63 percent of first serves, and he won four games in a row to take a 5-1 lead.
Third-seeded Hanescu rallied for 5-3, but Wawrinka saved two break points in the ninth game before clinching victory on a backhand netted by his opponent.
“I'm very happy to win here today. It has been an incredible week, in part because of you: you made me feel at home,” Wawrinka told a cheering Moroccan crowd.
It was Wawrinka's second title on the ATP Tour since he won at Umag, Croatia in 2006.
Wawrinka will face Hanescu again on Tuesday, at the Monte Carlo Masters.
“For me it was a very good week in Casablanca,” Hanescu said. “I played my best tennis. Maybe not today but Stanislas was very good and very aggressive, and he deserved to win the trophy.”
In Marbella, Spain, Flavia Pennetta claimed the ninth title of her career when she fought off a stiff challenge from Carla Suarez Navarro to beat the Spaniard 6-2 4-6 6-3 in the final of the Andalucia Open on Sunday.
The Italian second seed had not dropped a set all week on the clay in Marbella but Suarez Navarro made good use of her booming backhand to level the match at one set all.
Both players struggled to hold serve in the decider before Pennetta, 28, dashed the 21-year-old eighth seed's hopes of making amends for her defeat to Serbia's Jelena Jankovic in last year's title match.
Suarez Navarro saved one match point at 30-40 down on her serve but Pennetta sealed her seventh clay title two points later and punched the air in delight before embracing her opponent at the net.
"I just got the better of her at the end," Pennetta, who was treated for cramp in the third set, told a news conference.
"I started well then got a bit tired and Carla started playing more aggressively."
In Houston, third-seeded Sam Querrey reached the final of the US Men's Clay Court Championships Saturday with a victory over Wayne Odesnik, who was playing with the threat of a drugs ban looming.
Querrey, who said before the match that he would "refuse to lose" to Odesnik, triumphed 7-6 (7/3), 1-6, 7-5, rallying from a third-set deficit to deny Odesnik his second straight trip to the final.
Odesnik pleaded guilty in an Australian court on March 26 to importing human growth hormone into Australia.
He has denied taking the banned performance enhancer and is playing pending an investigation by the International Tennis Federation that could result in a suspension.
Regardless of the outcome of the ITF's probe, Querrey said Odesnik owed the sport an apology.
"I think you have to wait and find the verdict at the end of it all," Querrey said. "Yeah, he should apologize." Odesnik referred all questions about his case to his lawyer.
Odesnik, who lost in the final here last year to Australian Lleyton Hewitt, made the most of Querrey's struggles with his big serve, but surrendered the match along with his own serve in the final game.
In the final, Querrey will face Argentina's Juan Ignacio Chela, who beat sixth-seeded Argentinian Horacio Zeballos 7-5, 6-2.