Protests against the funding of the National Portrait Gallery have been going on for years.
The portrait prize has been supported by the gallery for more than 30 years.
Past winners called on the gallery to cut ties with the firm, and protesters covered themselves in oil at the venue.
Culture Unstained said the news was a major win for the campaign against fossil fuel sponsorship.
The director of the National Portrait Gallery said he was grateful to the company.
He said that the funding has fostered creativity, encouraged portrait painting for over 30 years and given a platform to artists from around the world.
The London gallery is closed for the foreseeable future and the Portrait Award will not be staged in the foreseeable future. The funds will be used for other work at the gallery before it re-opens next year.
The current contract will end in December. As it tried to achieve its goal of becoming net-zero by the year 2050, the company said it would look for new ways to use its talent, experience, and resources.
It is not clear how the competition will be funded in the future due to the swine flu.
Gary Hume, an artist and judge of that year's portrait award, said it was time to look elsewhere for money. He told the Today programme that the problem with the oil company was now a problem.
Dozens of other artists, including Sir Antony Gormley, Anish Kapoor, Sarah Lucas and Rachel Whiteread, signed a letter asking the gallery to end the sponsorship deal because of the role played by the oil company in furthering the climate crisis.
The semi-naked protesters drenched themselves in oil at the gallery in October.
The Royal Shakespeare Company and BP ended their partnership in 2019. The British Museum and the Royal Opera House are still sponsored by the firm.
Louise Kingham said that the company is proud of its role in British arts and culture for over 30 years, but that it is a different company now.
In order to become an integrated energy company, the company has pledged to reduce its reliance on fossil fuels.
While the gallery won't say it out loud, this is clearly a vote of no confidence in the business of the oil company. The company spent 30 years painting a picture of itself as a responsible philanthropist but it is rapidly running out of places to clean up its image.
The portrait award from the National Portrait Gallery is the most prestigious of its kind.
The last winner was Charlie Schaffer, who won the first prize for his portrait of a close friend.