BIRMINGHAM, England — The two-time Wimbledon champion Petra Kvitova beat the unseeded Ashleigh Barty of Australia, 4-6, 6-3, 6-2, in the Aegon Classic final on Sunday to win her first title since her playing hand was injured in a knife attack.

Kvitova, the No. 7 seed, was playing in her second tournament and her seventh match since she was attacked in December at her home in the Czech Republic.

“I think I’ve been through a very difficult time in my life,” she said, “and it wasn’t about the tennis but about coming back healthy and alive and moving my fingers properly, and everything like that.”

The win was the left-handed Kvitova’s first grass-court final since her triumph at Wimbledon in 2014, and the 20th title of her career. It also established her as a favorite at Wimbledon, which is set to begin July 3 without the defending women’s singles champion, Serena Williams, who is pregnant with her first child.