Harry Styles met his new girlfriend through an ex-lover.

The One Direction hunk is said to be ''having fun'' with writer-and-actress Erin Foster - who has previously been romantically linked with Ryan Gosling and Samantha Ronson - in recent weeks but he first got to know her through Kimberly Stewart, who he briefly dated last year.

A source told Grazia magazine: ''Erin and Harry met through Kimberly Stewart over a year ago and stayed in touch.

''Erin's dad David is a top music producer and a good friend of Kimberly's dad Ro.

''When Harry was seeing Kimberly briefly last year, he stayed at the Stewarts' mansion and saw David a lot.

''He first met Erin at Penny Lancaster's birthday last year and they've been hanging out in LA. After visiting the pumpkin patch, they went for dinner. It's nothing serious, but they're both having fun.''

Harry - who has previously dated Caroline Flack, Taylor Swift and Kendall Jenner - was recently romantically linked with Katy Perry after they enjoyed an intimate dinner.

A source said: ''They like each other. Katy and DJ Diplo are casually dating, but she's developed a huge crush on Harry, which she calls unexpected.

''He looks up to Katy and loves that she isn't your typical needy twenty-something.''