The injury-plagued Andujar became the lowest-ranked ATP title-winner since Australian Lleyton Hewitt won in Adelaide as the world number 550 in 1998.
Twenty sixth-ranked Edmund's firepower made little impact on the slow surface and he struggled badly on serve, dropping his delivery six times as he slumped to defeat.
Andujar, 32, wrapped up victory in one hour 22 minutes to complete a remarkable return from injury.
He was ranked down at 1,824 in February after three elbow operations had threatened his career and arrived in Morocco at 355 having won a Challenger Tour event in Alicante last week.
"I always believed that I could come back, otherwise I wouldn't have tried," Andujar said.
"I played very well during the whole match. He attacks a lot and is a very strong player. I was very solid today and I'm very happy about that."
(Reporting by Martyn Herman; Editing by Toby Davis and Clare Fallon)
