In a blow to traditional Spanish "machismo," a court has handed down the country's first conviction in a sexual harassment case, authorities said on Thursday.

A Barcelona court on Wednesday found Jose Luis Balaguer, chief of security for a shopping center, guilty of harassing his female subordinate and ordered him to pay about $5,000 in fines and compensation, a court spokeswoman said.It was the first sexual harassment sentence under Spain's new legal code, which defines the practice as a crime for the first time. The new rules replaced a 1848 code designed to bring Spanish law in line with modern-day crimes.

Prosecutors in the case said Balaguer, who was the woman's boss, repeatedly made unwanted sexual advances to her between December 1996 and Febuary 1997.

The court ruled that Balaguer had taken advantage of his post and had made his co-worker "fear she would lose her job" if she did not accept his advances.

The court imposed the fines for harassment and also ordered compensation for what it described as "the trauma or change of personality" the woman suffered as a result.

Accusations of sexual harassment remain rare in Spain, where men still dominate the hierarchy of government and business. But the issue has begun attracting greater attention.