Chelsea legend Didier Drogba has confirmed his retirement from playing, ending "an amazing 20 years".

The Ivory Coast striker, 40, had two spells at Chelsea, scoring 164 goals in 381 games and winning four Premier Leagues and the 2012 Champions League.

He spent the last 18 months of his career with US side Phoenix Rising, the club he co-owns.

"After 20 years, I have decided to put an end to my playing career," he told BBC World Service's Sportshour.

It had been expected Drogba would retire after the United Soccer League Cup final earlier this month, with his last game a 1-0 defeat by Louisville City in the final of the United States' second tier.

"It's the best way to end, helping some young talent to develop," he said.

"To give something back to the game was the best way to finish as I have learned so much in the game."

Drogba did not play top-flight football until the age of 23, when French side Guingamp signed him from Ligue 2 Le Mans in January 2002.

He moved to Marseille 18 months later - and the following year completed a reported £24m move to Chelsea, where he had the best spell of his career.

Didier Drogba won four Premier League titles, four FA Cups, three League Cups and the Champions League with Chelsea

Drogba won three Premier League titles in his first eight years at Chelsea, including in each of his first two seasons in England, as well as four FA Cups and two League Cups.

He also won the Premier League Golden Boot in 2006-07 and 2009-10.

He left on a high, scoring the winning penalty in the Champions League final shootout against Bayern Munich.

Drogba then spent six months with Shanghai Shenhua and a year and a half with Galatasaray before returning to Chelsea.

He scored seven goals in 2014-15, winning a fourth Premier League title and a third League Cup, leaving the club as their fourth highest scorer of all time.

In 2015, he joined Major League Soccer side Montreal Impact and then became player-owner of Phoenix Rising.

He scored 65 times in 105 caps for the Ivory Coast, playing in three World Cups and being named African Footballer of the Year twice.

Didier Drogba scored in the first three of the Rising's play-off games, as they won the USL Western Conference Championship, but failed to score in the final as they lost 1-0

Drogba's career in his own words

Didier Drogba has looked back on his career and life with Football Focus - watch the full interview on Saturday's programme at 12:00 GMT on BBC One.

'My mum was in tears' - growing up and leaving Ivory Coast

Drogba grew up in the Ivorian capital Abidjan and moved to France at the age of six to live with his uncle.

"Tito means 'my friend'. My mum calls me this. She was young when she had me so I was a friend, a confidant, someone she can rely on. Still now she calls me that because things will never change.

"What I remember is a young kid always with his mum and dad. My mum was 16 when she had me and my dad was working at the bank. My uncle was living in Europe and coming back and forth. I was curious to see what was happening on the other side of the world, he was always bringing sweets or footballs or shirts.

"The idea of leaving Ivory Coast when I was six came when my uncle and his wife came to Ivory Coast and she was playing with me and I got close to her. My dad wanted me to go to France to have a better chance to study, a better chance than he had.

"I was excited to leave Ivory Coast and go to France until I got to the airport. My mum was in tears, I could see sadness in her face. I realised this six-year-old would leave his mum and dad to go to a place he doesn't even know. As a kid I was sad too, everything changed."

'Why are you playing at right-back?' - start of a career

"I was 11 when I started playing with a team for the first time in the north of France in Dunkirk.

"I started as a right-back. I was going up and down, scoring goals from set-pieces, coming inside and shooting. My uncle said 'why are you playing as a right-back? As a family we only have strikers'.

"When I moved to another city I introduced myself as a striker. Luckily enough I scored 40 goals that season and that's where everything started.

"Before joining Le Mans in 1998 I was writing letters to first division teams for a trial and I would never get a positive answer but I never gave up. When I had the chance to go to Le Mans I jumped on it.

"Moving to Marseille was part of my dream - I used to say to my friends when I was at Le Mans 'you will see one day I will play with this team'. In 2003 I moved to Marseille so my dream became a reality. It was the best dream I ever had in my life."

'He changed my life' - finding Jose

In 2004, Drogba was signed by Chelsea boss Jose Mourinho for £24m.

"When someone gives you the chance to buy one of the best players in the world and he says 'no, this is the guy I want' it makes you feel special. I always tried to give it back to him.

"He changed my life, he changed the story of my family. He told me if you want to be the best you have to come and play with one of the best teams in the world and one of the best managers in the world… no, the best manager in the world. Everyone was saying £24m was a lot of money. People doubted. When I left I think the way everyone reacted, I think I covered the investment.

From hospital to Champions League hero

In August 2011, Drogba was knocked unconscious in a game against Norwich and taken to hospital. Nine months later he would score the decisive penalty to secure Chelsea's first ever Champions League title.

"If it was a movie, I don't know if you could have written the scenario better. The last Chelsea game for me, last chance to play in the Champions League final.

"The season was not going so well for me, I had quite a few injuries and months before that I was at the hospital. To have the chance to be in the most important day of this club after this big incident that really scared me, that was the best moment as a player with a Chelsea shirt."

'I would imagine fans celebrating' - coping in the big moments

"When I was in big games I was always reminding myself that when I was outside my parents' house, putting the ball on the ground and thinking about scoring a penalty in the last minute of a game - I was in a world where I would imagine fans celebrating. These dreams were so powerful that when I had a chance to realise them, I knew being in a final was a lucky part of my career."

Bringing peace to a nation

Moments after helping the Ivory Coast secure World Cup qualification in 2005, Drogba sent an impassioned message for peace to his civil war-torn nation. Within a week there was a ceasefire.

"Before being a footballer, I'm a human being, I'm a man. I have a life to lead, I want to live in a peaceful country. My country was at war and tensions were there. I care for my country and I did what I had to do for my country. The country is divided and the only thing that unites us is football.

"When I decided to play for Ivory Coast I didn't know I would one day captain the team and lead them to three World Cups tournaments. I never imagined that, that I would play such an important role in the country's history. I had the opportunity to play for France, but what I achieved with Ivory Coast - and as a man - I don't think I could have done that for France."