"The success the club has had has also come along with difficult moments for myself and my family," Rosell said after a board meeting held by the Spanish champions.
"There have been threats and accusations which make you consider your position including the claim of misappropriation of funds and the court case. I've always stated that we acted correctly with the Neymar transfer."
Rosell said that senior vice-president Josep Maria Bartomeu would replace him as Barca chief until his presidency was due to end in two years' time.
Judge Pablo Ruz on Wednesday ordered the start of a hearing to investigate Barcelona for alleged misappropriation of funds over the signing of Brazil's 2014 World Cup hope Neymar, saying Rosell could be called in person to give evidence.
"This board is a team and this group has led a project that has had a lot of success," Rosell said "I don't want attacks to affect the club and for that reason I have resigned permanently as president of FC Barcelona.
Rosell won the presidency in 2010 with 35,021 votes, more than any other man in the club's history, and Barca have since won two La Liga titles and the Champions League plus a host of other trophies.
Coming from a background in sports marketing, Rosell has valuable contacts in the football world - but at the same time he lost support among fans, being regarded as unapproachable and aloof.
It was the purchase of Neymar last June - which appeared to be a major coup for Rosell after he fought off competition from other top clubs in Europe for the player's signature - that has led to his downfall.
The Brazilian was paraded as a 57.1 million euros ($78.12 million) signing from Santos but the precise details of the contract were not revealed due to a confidentiality agreement.
A hearing will now decide whether any wrongdoing took place after legal action was pursued by disgruntled fan Jordi Cases in a bid for clarity.
Judge Ruz will ask for more information from Neymar, Santos and Barca and a decision will be made at a later date over whether Rosell will be called in person to provide evidence.
On the evidence already received, an order from the judge on Wednesday read: "It leads to the conclusion that the facts given by the complainant are plausible in being a crime of misappropriation as laid down in article 252 of the penal code."
- Sports & Recreation
- misappropriation of funds