When, in any statutory or home rule charter city, no jail exists, which in the judgment of the city council, or other governing body, is sufficient or suitable for the detention of persons lawfully under arrest in the city, the council, or other governing body, may cause persons lawfully arrested to be detained in any city or county or county regional jail or lockup in the same or in an adjoining county; provided, that that detention shall be with the consent of the city or county or regional jail board operating the jail where the persons are detained, and that there shall be paid to the city or county or regional jail board the necessary cost and expense which may be incident to taking care of persons while they are lawfully detained or imprisoned.