A court in Frankfurt convicted Kreshnik Berisha of membership of a foreign terrorist organisation.
Berisha avoided the heaviest sentence of 10 years after admitting he spent six months with IS in Syria last year.
German authorities believe more than 500 German citizens have travelled to fight for IS in Iraq and Syria.
The domestic intelligence agency estimates that 60 have died there in combat or suicide attacks, and 180 have returned to Germany, according to the AFP news agency.
Berisha, 20, was arrested at Frankfurt airport last December after returning from Syria.
He was accused of having been with IS fighters in the northern Syrian city of Aleppo, where rebels are fighting against forces loyal to the Syrian President, Bashar al-Assad.
He was put on trial in September and was offered a deal by prosecutors, where he would receive a lighter sentence in exchange for confessing.
Prosecutors also suggested the deal would include receiving information from Berisha about the inner workings of the group.
Berisha was born in Frankfurt to a family from Kosovo.
IS is thought to have attracted hundreds of recruits from European countries in its battle to establish what it describes as a "caliphate", spanning a borderless stretch of Syria and Iraq.
The US launched air strikes against the militants following their seizure of several towns and cities in northern Iraq this summer.
Separately, Britain has jailed its first citizen to be convicted of involvement in terrorism in Syria.
Mashudur Choudhury, who was convicted in May, was sentenced to four years imprisonment.
He was one of a group of six men from Portsmouth who are known to have gone to fight in Syria. Four of them have been killed.
A German man has been jailed for three years and nine months for joining Islamic State (IS) militants, in the first trial of its kind in Germany.