The mosque of Madina was not only the place to worship Allah but also a school for the believers where they learned about Islam. When Prophet Muhammad (PBUH) was present in mosque, believers used to hear His words of wisdom, explanation on the verses of Holy Quran and benefited from His guidance. When Prophet Muhammad (PBUH) was not present in the mosque, some of the companions who were very close to Prophet (PBUH) used to share their knowledge with others.
Once, Prophet Muhammad (PBUH) entered the mosque before the prayer time. He found two groups were present in the mosque. One group was of those companions who were busy in their own worship. Some of them were reading Quran and others were busy in supplicating. The other group was busy in learning. They were learning how to read and write as well as how to implement other teaching of Islam in their daily life.
Looking at the both group, the Prophet Muhammad (PBUH) said: “They are both engaged in useful pursuits. But I am a teacher. I shall join the group assembled to learn.”