The sum of three per centum (3%) shall be deducted from the salaries or wages of all officers and employees of such cities as and when paid. This sum shall be retained by the city treasurer, and is hereby set apart as a pension fund free from the control of such cities for any other purpose or expenditure.