Williams lost her serve twice in the first set and appeared to be in trouble against the 16th-seeded Spaniard Martinez, twice winner of the event.
But Williams, the fourth-seed, took over the match in the last two sets and showed much of the poise and confidence she had before injuries slowed her down in the past year.
"The first set was a little bit shaky for me," Williams told reporters. "I had to adjust to her game."
It was the American's first tournament win since February 2003 in Antwerp, Belgium. She suffered an abdominal injury soon after that success and was sidelined for a lengthy period.
Martinez, playing in her first final for four years, controlled the first set but could not match Williams's strength on long rallies as the match wore on.
Martinez is 0-5 in three-set matches this year.
Many of the top players in the field withdrew earlier in the week with injuries, including Williams's sister Serena who has a knee problem.
More from rediff