After leaving a late-night party the two men aged 23 and 24 used scaffolding and a ladder to scale and enter the Germanisches Nationalmuseum in Nuremberg.
Once inside they used the light from their cellphones to navigate the museum's galleries before settling on Emil Nolde's 1910 work Herr und Dame as a trophy worthy of the one just awarded to the national team in Brazil.
Valued at €900,000, the painting was fitted with a silent alarm which was activated as the pair removed it from the wall. The students, who both come from Erlangen, were picked up by police as they tried to leave the building.
"It was an act of huge stupidity and the greatest mistake of my life," one defendant told the court.
Prosecutors had pressed for stiffer sentences but the presiding judge showed leniency because of remorse shown by the men.
He also noted that the crime showed no signs of advance preparation, saying the "whole thing could hardly be called professional".