The mosque is located in the center of the group of buildings and in a location overlooking Gebze. It was built by Çoban Mustafa Pasha in 1510. It is understood that the construction of the complex was planned long ago and was revealed through an anonymous work.