In all counties of the first, second, third, and fourth classes, and in any county with a charter form of government and with more than two hundred thousand but fewer than three hundred fifty thousand inhabitants, each county officer may, subject to the approval of the governing body of the county, contract with the governing body of any municipality located within such county, either in whole or in part, to perform the same type of duties for such municipality as such county officer is performing for the county. Any compensation paid by a municipality for services rendered pursuant to this section shall be paid directly to the county, or county officer, or both, as provided in the provisions of the contract, and any compensation allowed any county officer under any such contract may be retained by such officer in addition to all other compensation provided by law.
§ 50.332, RSMo