The messages, which will appear instead of paid-for ads, will ask users to close their web browsers.
The move comes as part of a continuing effort to stop piracy sites from earning money through advertising.
Police said the ads would make it harder for piracy site owners to make their pages look authentic.
"When adverts from well known brands appear on illegal websites, they lend them a look of legitimacy and inadvertently fool consumers into thinking the site is authentic," said Detective Chief Inspector Andy Fyfe from the City of London Police Intellectual Property Crime Unit (Pipcu).
"This new initiative is another step forward for the unit in tackling IP crime and disrupting criminal profits.
"Copyright infringing websites are making huge sums of money though advert placement, therefore disrupting advertising on these sites is crucial and this is why it is an integral part of Operation Creative."
Sunblock
The initiative will make use of technology provided by Project Sunblock - a firm used by major brands to stop adverts appearing alongside questionable content such as pirated material or pornography.
Many websites - including those offering pirated content - will use syndication networks to place advertisements on their pages.
Brands use the syndication networks like a wholesaler, and so may not be clear what sites their advert will eventually appear on.
Project Sunblock detects the content of websites to prevent brands' ads appearing where they do not want them.
When a website on Pipcu's Infringing Websites List (IWL) tries to display an advert, Project Sunblock will instead serve the police warning.
Neither the police or Project Sunblock are paying the website in question to display the police message.
Piracy battle
In the past, some have raised concerns about Pipcu's process in adding a website to the IWL.
Ernesto Van Der Sar is the editor of Torrentfreak, a news site that covers issues around online piracy. When Pipcu announced its intentions in March this year, Mr Van Der Sar said he worried about the implications.
"As with all blocklists there is a serious risk of overblocking," he said.
"Without proper oversight, perfectly legal sites may end up losing good advertising opportunities if they are wrongfully included."
The battle against online piracy has seen content creators attempt many different strategies in order to stem the flow of illegal downloading.
In the UK, the courts have ordered internet service providers to block almost 50 different websites offering pirated content, either by direct download or through peer-to-peer sharing.
While effective in lowering the traffic of these sites, filtering is a flawed prevention method - many internet users are adept in using different technologies to circumvent the court-imposed restrictions.
This latest attempt looks to hit the owners of these websites in a more painful way - by stopping advertising revenues from coming in.
Source: BBC News