ANKARA, April 26 (Reuters) - Iran has handed jail sentences to four journalists on security-related charges, the Tasnim news agency said on Tuesday, in verdicts that underscore the continued grip of hardliners over the judiciary despite gains by reformers in February elections.

The four pro-reform journalists have been found guilty of various charges, including "spreading propaganda against the Islamic Republic" and "acting against national security and contacting foreign governments", the semi-official Tasnim news agency reported. It gave no other details about the charges.

The popularity of moderate President Hassan Rouhani has soared since he signed a deal last year with world powers to curb Iran's nuclear programme in exchange for lifting sanctions, a move that was largely opposed by anti-Western hardliners.

The deal helped his supporters to rack up impressive gains in the February general election, but the hardline allies of Supreme Leader Ayatollah Ali Khamenei control many key institutions including the judiciary.

They fear that opening up Iran to the West may weaken their grip on power in the country's complex political system. In recent months security officials have arrested dozens of journalists, dual-citizens and activists as part of a crackdown on "Western infiltration".

A lawyer for three of the convicted journalists, Mohammad Alizadeh-Tabatabai told Tasnim the prison sentences had been handed to his clients on Tuesday when they appeared in court.

They have 21 days to appeal against their sentences.

"Davoud Assadi was sentenced to 10 years, Afarin Chitsaz to five years, Ehsan Mazandarani seven years and Ehsan Safarzayi to five years in jail," Alizadeh-Tabatabai said, adding that the journalists would appeal.

Mazandarani, editor-in-chief of the reformist newspaper Farhikhtegan, was previously arrested in March 2013 with a group of other journalists but was released on bail three weeks later.

Chitsaz and Safarzaie were arrested in November 2015 by Iran's elite Revolutionary Guards, who are loyal to Khamenei.

Human rights groups and Western countries have criticised Iran's record on free speech. The United Nations has also rapped Tehran in statements for "curtailing the rights to freedom of expression, association and assembly, arresting and imprisoning journalists, human rights defenders, trade unionists and others who voiced dissent, on vague and overly broad charges".

Iran denies such charges and accuses the West of also violating human rights.

The Committee to Protect Journalists and rights groups have called on Iran to immediately release all detained journalists.

(Writing by Parisa Hafezi; Editing by Gareth Jones) ((parisa.hafezi@thomsonreuters.com; +90 532 176 3452; Reuters Messaging: parisa.hafezi@thomsonreuters.com))

Keywords: IRAN JUDICIARY/PRESS