The actor had a relationship with the former 'Charlie's Angels' star from 1979 until her death from cancer in 2009 and became locked in a battle with the university of Texas, who claimed she had left them the painting - valued at up to $12 million - in her will.
Ryan countered while she had left her art collection to the university, the painting, one of two made by the pop artist, was actually his and had been given to him by Warhol himself, as a gift for arranging the session where it was created.
Ryan took his portrait from Farrah's home soon after her passing, under the permission of the trustee of her belongings.
Lawyers for the university attempted to discredit O'Neal's claims by using footage from Fawcett's reality show and a '20/20' TV segment documenting the creation of the portraits.
In footage from her show, Farrah can be seen telling the owner of an auction house she had two Warhol portraits and was considering whether to sell one.
Ryan's lawyers were quick to note she never said on camera she owned both pieces of art.
The 72-year-old actor - who has son Redmond, 28, with Farrah - said the picture is one of his most prized possessions.
During his testimony he said: ''I talk to it. I talk to her. It's her presence. Her presence in my life. In her son's life.''
Following the court's ruling, he will keep the picture in his beachside home and hopes to one day pass it down to Redmond.
Martha is soon caught in the middle of a hitman war.
News on Bran, Dany and Arya in these latest images.
Everyone wants this year to be Leo's year.
It's been 15 years since Zoolander hit movie screens in 2001.
Rebel Wilson has taken the world by storm after arriving in America five years ago.