
758 P.2d 756 (1988)
MONTANA DEACONESS MEDICAL CENTER, a non profit corporation, Plaintiff and Respondent,
v.
Carl E. JOHNSON, Defendant and Respondent.
CITY OF GREAT FALLS, Montana, Defendant, Third-Party Plaintiff and Appellant,
v.
COUNTY OF CASCADE, Montana, Third-Party Defendant and Respondent.
No. 88-91.
Supreme Court of Montana.
Submitted on Briefs May 26, 1988.
Decided July 7, 1988.
David V. Gliko, City Atty., Great Falls, for defendant, third-party plaintiff and appellant.
Sharon M. Anderson, Patrick L. Paul, Co. Atty., Great Falls, for third-party defendant and respondent.
David J. Patterson (MACO), Missoula, James T. Harrison, Jr. (Sheriffs), Helena, Jim Nugent (Mont. League of Cities & Towns), Missoula, for amicus curiae.
SHEEHY, Justice.
In this case we are asked to determine whether the City of Great Falls (City) or the County of Cascade (County) is ultimately responsible for medical costs incurred by a person in the custody of City Police Officers *757 as a result of a felony arrest. The District Court of the Eighth Judicial District, Cascade County, determined that the controlling factor was the City's custody over Johnson at the time the medical expenses were incurred and issued an order dismissing the City's third party complaint against the County. We reverse.
The facts, as stipulated by the parties, are as follows:
1. On January 4, 1987, Johnson was arrested by City Policemen.
2. The officers immediately determined Johnson's life was in jeopardy as a result of his ingestion of a quantity of prescription pills.
3. The officers requested an ambulance which arrived at the scene of the arrest and transported Johnson to Montana Deaconess Medical Center (Deaconess).
4. Deaconess was advised Johnson was under arrest when Johnson arrived.
5. Johnson incurred reasonable medical charges from January 4, 1987, until his release on January 5, 1987, in the amount of $2,193.13, after two days in Deaconess's Intensive Care Unit.
6. Deaconess made demand for full payment to Johnson and Third Party Plaintiff City, and to Third Party Defendant County.
7. The City and County have refused to pay said bill.
8. Johnson admits liability for Deaconess's claim but he is indigent and has no present or future means to pay the charges.
9. Johnson was "booked in" in absentia at the Police Department on January 4, 1987.
10. Johnson was released by Deaconess on January 5, 1987, and transported to the City Police Department.
11. Johnson was detained at the City Police Department until his initial appearance on January 6, 1987, before the County Justice of the Peace and subsequently detained in the County Jail. The County Jail is operated and managed by the County Sheriff's Department.
12. Initial charges of aggravated assault, aggravated kidnapping and sexual intercourse without consent, all felony offenses under the Montana Criminal Code, were filed in the County Justice of the Peace Court (later transferred to the District Court) and accepted by the County Attorney. No misdemeanor or felony charges of any kind were filed with the City Court.
Generally, persons under official detention have a constitutional right to adequate medical care, regardless of their ability to pay. City of Revere v. Massachusetts General Hospital (1983), 463 U.S. 239, 103 S.Ct. 2979, 77 L.Ed.2d 605 (due process demands that persons detained by government agencies receive adequate medical care; responsibility for costs is a matter of state law). Consistent with the mandate of the United States Supreme Court, the Montana Legislature has adopted legislation providing for the care of prisoners. Section 7-32-2222, MCA, provides:

Health and safety of prisoners. (1) When a county jail or building contiguous to it is on fire and there is reason to believe that the prisoners may be injured or endangered, the sheriff, jail administrator, or private party jailer must remove them to a safe and convenient place and there confine them as long as it may be necessary to avoid the danger.
(2) When a pestilence or contagious disease breaks out in or near a jail and the physician thereof certifies that it is likely to endanger the health of the prisoners, the district judge may by a written appointment designate a safe and convenient place in the county or the jail in a contiguous county as the place of their confinement. The appointment must be filed in the office of the clerk and authorize the sheriff, jail administrator, or private party jailer to remove the prisoners to the designated place or jail and there confine them until they can be safely returned to the jail from which they were taken.
(3) If in the opinion of the sheriff, jail administrator, or private party jailer any prisoner, while detained, requires medication, medical services, or hospitalization, *758 the expense of the same shall be borne by the agency or authority at whose instance the prisoner is detained when the agency or authority is not the county wherein the prisoner is being detained. The county attorney shall initiate proceedings to collect any charges arising from such medical services or hospitalization for the prisoner involved if it is determined the prisoner is financially able to pay.
Although the City contends that § 7-32-2222(3), MCA, when viewed in its entirety, indicates that persons charged with violations of state law occurring within a county are the financial responsibility of that county, we do not find the statute to be controlling. By its terms, § 7-32-2222(3), MCA, is not triggered until such time as "the sheriff, jail administrator, or private party jailer" determines that a detained person requires medical care. In addition, the statute, when read as a whole, assumes incarceration in the county jail at the time the need for medical care arises. Such is clearly not the situation in the instant case.
Moreover, § 7-32-2222(3), MCA, is obviously designed to fix financial responsibility for medical costs on the agency for which the prisoner is being detained in the county jail. This section recognizes that frequently county jails in Montana are used to house federal prisoners or persons held for violations of municipal laws.
When confronted with the issue now before us, the courts of other jurisdictions have split along two lines of reasoning. Under the minority "custody and control" approach, the financial responsibility for medical costs is determined on the basis of which agency had custody at the time the treatment is provided. See e.g. Sisters of the Third Order of St. Francis v. Tazewell County, (1984), 122 Ill. App.3d 605, 78 Ill.Dec. 230, 461 N.E.2d 1064. "[If] physical control is [subsequently] transferred [during the course of the treatment] the responsibility is transferred along with it and the cost of care [is] prorated." Cuyahoga County Hospital v. City of Cleveland, (1984), 15 Ohio App.3d 70, 472 N.E.2d 757, 759. Few jurisdictions have followed the lead of the Ohio and Illinois courts, however.
The majority "nature of the crime" approach determines financial responsibility not on the basis of which agency first takes a person into custody, but rather on the basis of the crime ultimately charged. See Wesley Medical Center v. City of Wichita, (1985), 237 Kan. 807, 703 P.2d 818; L.P. Medical Specialists v. St. Louis County, (Minn.App. 1985), 379 N.W.2d 104; Zieger Osteopathic Hospital v. Wayne County, (1984), 139 Mich. App. 630, 363 N.W.2d 28; Albany General Hospital v. Dalton, (1984), 69 Or. App. 204, 684 P.2d 34; St. Mary of Nazareth Hospital v. City of Chicago, (1975), 29 Ill. App.3d 511, 331 N.E.2d 142; Washington Township Hospital District of Alameda County v. County of Alameda (1968), 263 Cal. App.2d 272, 69 Cal. Rptr. 442. After carefully considering the arguments and authority supporting both positions, the Supreme Court of Kansas recently held:
... We have concluded that a city is not responsible for the payment of medical expenses incurred by an indigent person who is arrested by city police and subsequently charged with a violation of state law and who, before being physically transferred to the county jail, is taken to a hospital for necessary medical treatment. We hold that so long as an offender is arrested for violation of a state law and in due course is charged with a state crime and delivered to the county jail for confinement, the medical and other incidental expenses incurred as a consequence of and following his arrest, and until his transfer to such facility, are chargeable to the county. We further hold that a county's liability for charges and expenses for safekeeping and maintenance of the prisoner, including medical expenses, does not depend on which police agency happens to be called to the scene of the alleged crime or whether such expenses were incurred before or after he is placed in a county jail. The controlling factor is that the prisoner *759 was arrested and subsequently charged with violation of a state law.
Wesley Medical Center, 703 P.2d at 824. We agree.
A county is the largest subdivision of the state. Section 7-1-2101, MCA. Consequently, the county is vested with the primary responsibility of enforcing the laws of the state and maintaining facilities in furtherance of that task. See, §§ 7-4-2716, 7-32-2201, MCA. Sound reasoning dictates that the performance of the county's task necessarily includes the assumption of the associated financial burden.
We, therefore, hold that the county is financially responsible for medical costs incurred by a detained person ultimately charged with a violation of state law but who is unable to pay. The judgment of the District Court is reversed and remanded for proceedings consistent with this Opinion.
TURNAGE, C.J., and HARRISON, WEBER, GULBRANDSON, McDONOUGH and HUNT, JJ., concur.
