Spain's two main political parties have agreed on a new anti-terror law that introduces possible life sentences for perpetrators of deadly terror attacks.

The current maximum prison sentence for any crime in Spain is 40 years, though it is rare for anyone to serve that long.

The governing Popular Party and the main opposition Socialist Party announced the measures Monday after days of negotiations following attacks around Paris last month that left 20 people dead, including the three gunmen.

According to the proposed bill, anyone found guilty of carrying out a deadly terror attack can be handed a life sentence. However, in a compromise between the two parties, after serving 35 years a judicial review will decide whether they can be released.