Magaluf in Majorca attracts hundreds of thousands of British tourists each year on package holidays, lured by the promise of easy sex and plentiful alcohol, while Ibiza's San Antonio also has a reputation for hedonism.
Two police officers from Britain's West Midlands force will work alongside Spanish colleagues to help with investigations involving Britons as victims, witnesses or offenders, according to the force and Spain's Guardia Civil.
An estimated 85 percent of visitors to Magaluf come from Britain and Ireland, most on cheap package holidays that involve taking part in "pub crawls" along strips of bars.
The resort made global headlines last year after a video showing a young woman performing oral sex on several men on the dance floor of a nightclub went viral.
Local authorities subsequently introduced new rules regulating pub crawls and have also banned "balconing" -- jumping from one apartment balcony to another or into a swimming pool -- after several deaths in recent years.
"This trial reflects the close cooperation between our two countries on policing and security matters," said Britain's ambassador to Spain, Simon Manley.
"The presence of UK police officers will help to remind British holidaymakers of the importance of respecting local laws and customs, ensuring that everyone has a safe and enjoyable holiday, free from trouble and crime."
Spain already carries out international patrols in tourist areas in cooperation with police from Germany, France, Italy, Portugal and Morocco, according to the Guardia Civil.