MELBOURNE, Australia (AP) -- For 35 Grand Slam tournaments, the words of an Irish poet became something of a mantra for Stan Wawrinka. After one too many defeats, he had them inscribed on his left arm.

At each ball toss, if he cared to glance, he could see the words of Samuel Beckett: "Ever tried. Ever failed. No matter. Try Again. Fail again. Fail better."

He's going to have to come up with something new after beating top-ranked Rafael Nadal to win his first Grand Slam title at the Australian Open on Sunday night. Nadal was clearly hampered by a back injury after the first set, but Wawrinka blocked that out of his mind to win 6-3, 6-2, 3-6, 6-3.

Coming into the first major of 2014, Wawrinka hadn't beaten No. 1-ranked Nadal in a dozen matches, and had a 14-match losing streak against No. 2 Novak Djokovic, who won three straight Australian Open titles from 2011-'13. He wasn't even the highest-ranked player in Switzerland, not surprising considering he was playing in Roger Federer's generation.

"I had that quote in my head for a long time. It was part of my life, how I see the life, and especially how I see the tennis life," Wawrinka said of the Beckett quote.

He was pessimistic about anyone breaking the dominance of Federer, Nadal, Djokovic and Andy Murray -- the so-called Big Four who accounted for all but one of the previous 35 major titles.

"It's not easy because tennis life, when you lose, it's tough to get through and to take a positive from a loss, from failing from a tournament," he said. "So that's how I see, in general, my career. I always go back to practice to try to improve myself and to give me all the chance to beat the best player in the world."

After being the first man in 21 years to beat the top two players en route to a major title -- he beat Djokovic in the quarterfinals to avenge two five-set defeats to the Serbian in Grand Slams last year -- Wawrinka will move from No. 8 to No. 3 in the rankings. That's a projected five spots in front Federer, a 17-time Grand Slam champion.

Not surprisingly, Federer was the first to call to congratulate Wawrinka, after the new champion spoke on the phone with his own family back in Switzerland.

"I didn't call so many (people), but my wife, my daughter, my sister, and Roger called me," said Wawrinka, still clutching the trophy at a news conference more than two hours later. "So, yeah, was nice for me. I know that he's really, really happy for me."

Federer had wanted an all-Swiss final but lost to Nadal in the semifinals -- his 23rd loss in 33 matches against the Spaniard. Considering Wawrinka had only ever beaten Federer once, nobody really gave him a chance of stopping Nadal from becoming the first man to win each of the four major trophies twice in the Open era.

Nadal appeared to be on the verge of retiring in the second set, when he took a medical time out that frustrated Wawrinka. His service speed dropped dramatically, he wasn't retrieving as well as usual, and he was sweating on mistakes from the other side to pick up cheap points.

"It's really not the way you want to win a tennis match, but in a Grand Slam final I'll take it," Warwinka said.

Nadal has had cursed luck with injuries in Australia. He won the title here in 2009 and lost the 2012 final to Djokovic. But he missed the 2013 edition during a seven-month layoff with knee injuries and illness, and his quarterfinal losses in 2010 and 2011 were affected by injuries.

"It has been a very emotional two weeks -- I'm sorry to finish this way," he told the Rod Laver Arena crowd, at the same time commending Wawrinka for the way he played. "I tried very, very hard -- this year was one of the more emotional tournaments in my career.

"Last thing that I wanted to do was retire. I hate to do that, especially in a final."

Wawrinka recalled an agonizing loss of his own here -- going down in the fourth round to Djokovic last year in the longest Grand Slam match of the season -- as motivation for his surge up the rankings last year, achieved with the help of former No. 2-ranked Magnus Norman as coach.

"Rafa, I'm really sorry for you, I hope your back is going to be fine, you're a really great guy, good friend and really amazing champion," Wawrinka said as he accepted his first major trophy. "Last year I had a crazy match, I lost it. I was crying a lot after the match. But in one year a lot happened -- I still don't know if I'm dreaming or not but we'll see tomorrow morning."

When asked how he would celebrate, he said later: "There's a big chance I get drunk tonight, but we'll see."