Journalist released after nearly five months in detention