Russia has released an American man who was jailed for more than four years.