JOHANNESBURG (Reuters) - The American rapper known as Mos Def will be allowed to leave South Africa on Tuesday after he apologized for breaking immigration laws.

The rapper - whose real name is Yasiin Bey - was arrested in January after trying to leave South Africa on a "World Passport", which South Africa does not recognize as a legal travel document.

Bey, who has lived in Cape Town since 2013, will be declared an undesirable person for his actions and will not be granted re-entry to South Africa, the home affairs department said.

"(He) has unreservedly apologized to the Government of South Africa," it said in a statement.

"The department is satisfied with the apology (and) will withdraw the charges against him."

The World Passport is a document issued by a non-profit organization called World Service Authority, set up in the United States after World War Two to advocate for world citizenship.

Citing the United Nations' right to freedom of movement, it has been issuing World Passports since 1954.

Many countries do not accept the passport either as a travel document or a formal identity but WSA claims countries such as Togo, Mauritania, Ecuador, Zambia, Tanzania have accepted the 30-page document in the past.

(Reporting by Joe Brock Editing by Jeremy Gaunt)