The council voted to reject a permit application for a proposed mosque after a heated public hearing.