St Pauli have won back the lucrative marketing rights to their famous skull and crossbones logo, after a five-year legal battle with their merchandising partners.

The second-tier 2. Bundesliga club sold 90% of their rights to the firm, Upsolut Merchandising, in 2004 as part of a fight against bankruptcy. Efforts to reclaim them since 2009 appeared destined for court, but the settlement – involving the club paying €1.3m (£914,000) – means they will regain control of merchandising from 1 January next year.

The agreement - announced by president Oke Göttlich as “a milestone, a big step for our independence” – will provide a significant new revenue stream as they try to win back the Bundesliga status they lost in 2011.

The skull logo was first adopted by fans as an unofficial emblem during St Pauli’s mid-1980s transformation into an anti-establishment “Kult” club – based on left-leaning politics, anti-fascism and social activism.

The new ethos and radical identity earned a series of media nicknames in the 90s including “Buccaneers of the League” and “Brothel of the League”, and helped lift attendances from below 2,000. This month’s home game against Fortuna Dusseldorf attracted a crowd of 29,017.