SKOPJE (Reuters) - Macedonia's main opposition party said on Thursday it was boycotting parliament until the constitutional court rules on the status of a special prosecutor appointed to investigate a wiretapping scandal that has plunged the country into turmoil.

Macedonia has been in crisis since February least year, when opposition parties accused former Prime Minister Nikola Gruevski and his counter-intelligence chief of orchestrating the wiretapping of more than 20,000 people.

The crisis was worsened by President Gjorge Ivanov's decision to pardon 56 officials investigated over the scandal, which led to street protests and the cancellation of an election set for June 5.

Under pressure from the European Union and United States, Ivanov then revoked his decision to pardon the officials, removing an obstacle to possible prosecutions.

In an attempt to resolve the crisis, Macedonia's political parties agreed last year to an EU-brokered accord to hold the early election in June and to establish a special prosecutor's office to investigate allegations arising from the wiretapping.

The office of the special prosecutor is not part of the country's constitution, making it possible for those investigated to question its legality one day and escape prosecution.

The main opposition party, the Social Democrats, which holds 34 seats in the 123-seat parliament, said the constitutional court should rule whether the special prosecutor's office was in line with the country's constitution.

"The constitutional court must immediately give its opinion regarding the special prosecutor," leader of the Social Democrats, Zoran Zaev, told reporters.

Zaev said deputies from his party would not take part in the work of parliament until the constitutional court gives its opinion.

The court has been asked to rule on the matter but it is not on its calendar yet and it is not clear when a decision might come.

The Social Democrats accuse Gruevski and the ruling VMRO-DPMNE party of controlling the media and the judiciary. They say they will not agree to a new election date until conditions for a free and fair vote are created.

(Reporting by Kole Casule; writing by Ivana Sekularac; Editing by Giles Elgood and Alison Williams)