Anas (may Allah be pleased with him) reported that the Prophet (may Allah's peace and blessings be upon him) said:
“Whoever goes out to seek knowledge is in the cause of Allah until he returns.”
[At-Tirmidhi].