David Duchovny and Téa Leoni have ''always loved each other.''

The former couple got divorced recently after 17 years of marriage, but the 48-year-old actress insists they are still on good terms for the sake of their children, daughter Madelaine West, 15, and son Kyd Miller, 12.

The 'Madam Secretary' star told Parade magazine: ''Listen, David gave me the two greatest gifts on the planet; I don't know how I could ever hate him. We've always loved each other, and we adore these kids.''

She added: ''I'm not playing stupid - I understand feelings can get hurt and things can get icky. We've had our moments like that. But these kids are too important, and he feels the same way, I know it. He's a good guy ... There was that brief moment when the kids said, 'Oh, I can work a scam on you here and him over there,' and we were like, 'News flash - no!'''

'Californication' star David, 54, cited ''an irretrievable breakdown of the relationship'' when he quietly filed for divorce in June.

The duo, who both live in New York City, agreed to share joint legal custody of their children, but Téa has primary physical custody.

The pair got married in 1997 but separated in 2008 with Duchovny checking into a facility to be treated for sex addiction the same year.

The pair rekindled their romance before splitting again in June 2011.

In 2012, the former 'X-Files' star insisted they were still married, but separated.