Lewis Hamilton says he could decide to stop racing in Formula 1 by the end of the season but his hungry for competition remains sharp which has only been heightened in Mercedes' battle against Ferrari in 2017.

In an interview with the FIA-published Auto magazine, Hamilton has hinted about potentially leaving the sport by the end of the season but played down the suggestion having seen former team-mate Nico Rosberg exit last year.

Hamilton, who has a contract at Mercedes which expires in 2018, says even though the F1 cars haven't changed hugely in the 2017 regulation revamp the heightened competition has increased his hunger in the sport and Rosberg's sudden exit has fed that.

Heading into the Azerbaijan Grand Prix, Hamilton trails Sebastian Vettel by 12 points in the F1 world drivers' championship with the pair sharing three wins each so far in 2017.

"My destiny is in my own hands. I can decide to stop at the end of this year," Hamilton told Auto. "I don't like to plan for it because I don't know what's around the corner, I don't know what I'm going to do.

"Whatever I know I'm going to do, if I apply myself the way I've always applied myself in my racing and I apply it to anything else I want to do in life, or even if it's still in racing, I feel I can achieve great things.

"I'm never going to stop pushing the limits of whatever it is I do with myself and I'm always going to strive for greatness in whatever world it is that I'm in. So I think that mission or that mentality will create my legacy."

With Mercedes focus shifting from its two drivers solely battling for the F1 world title, it has seen a Ferrari resurgence which Hamilton says he has thrived upon after three consecutive campaigns battling his team-mate.

"Right now it's solely on competition," It feels the same car as last year [but now] we're just having a competition. If we're able to qualify the top 10 within half a second or something like that, now that's a race. Maybe top five within a few tenths of a second, that's racing man, because then every millimetre, every metre of braking counts.

"It's also easier battling another team. There's a whole mental shift, the whole team's dynamic shifts in a powerful way.

"When [the competition] is all within a team it's just like a big vortex, and depending on the tension it gets stronger and stronger and is actually not really what a team is built to be.

"Now having another team, we are pulling together with that same drive - it's just so much more powerful, it's really awesome."