
535 N.W.2d 609 (1995)
Patrick J. COONEY, Petitioner, Appellant,
v.
Bolden HOOKS, Defendant,
Hennepin County, Respondent.
No. C4-93-1877.
Supreme Court of Minnesota.
July 28, 1995.
*610 Patrick W. Ledray, Minneapolis, for appellant.
Michael O. Freeman, Hennepin County Atty., Karla F. Hancock, Sr. Asst. County Atty., Minneapolis, for respondent.
Heard, considered and decided by the court en banc.

OPINION
COYNE, Justice.
Plaintiff Patrick J. Cooney sued Hennepin County and Bolden Hooks, claiming that while he was detained on a DWI charge in the Hennepin County Adult Detention Center (hereafter "jail"), he was sexually assaulted by Hooks, a fellow detainee. Hooks was subsequently acquitted of a felony charge arising from the incident. The issue in this suit against defendant county is whether the county is civilly liable for negligent breach of a duty to protect plaintiff from such an assault by a fellow detainee. A district court jury thought so, finding in plaintiff's favor. The trial court, however, granted defendant county judgment notwithstanding the verdict. The court of appeals, by a 2-1 vote, affirmed judgment notwithstanding the verdict in an unpublished opinion. Looking, as we must, at the evidence in the light most favorable to the jury's verdict in plaintiff's favor, we nonetheless conclude that the evidence does not support plaintiff's contention that defendant county negligently breached any duty it owed plaintiff to protect him while he was a detainee in the jail.
Shortly after 1:00 a.m. on April 6, 1988, a Minneapolis police officer lawfully stopped Cooney as he was driving home from a party at a Minneapolis bar. After determining that Cooney was under the influence of alcohol, the officer arrested Cooney for DWI and took him to the county jail.
There a sheriff's deputy received and inventoried Cooney's personal property and completed a medical screening form. Cooney answered yes when asked if he felt suicidal. A registered nurse to whom the matter was briefly referred spoke with the deputies who had talked with plaintiff and concluded that it was not necessary to place him in a separate holding cell, something that is done if the nurse believes the detainee presents a serious physical risk to himself or to others and needs to be monitored constantly.
At 2:43 a.m. Cooney was formally booked; then he was photographed and fingerprinted. About 2:50 a.m., after Cooney had cleaned the ink from his fingers, he was placed in a cell occupied by two other detainees. One of these detainees, D.E., was being held on a charge of driving after suspension. The other, Hooks, was being detained for misdemeanor trespass.
Cooney, arguing that the trial court erred in granting judgment notwithstanding the verdict, relies heavily on the opinion of his expert witness that although the jail facility, which has been accredited by the American Correctional Association, met national standards with respect to construction, the jail's policy of checking each cell every 30 minutes does not amount to the direct supervision he believes should apply to the detention of an extremely inebriated detainee.
Cooney presented expert opinion testimony that from 2:00 to 3:00 a.m. his blood alcohol concentration was between .25 and.30 and that, therefore, he was "significantly impaired." Cooney's own evaluation of his condition was that he was minimally impaired, and both the arresting officer and the deputy sheriffs involved in Cooney's booking and detention considered his speech coherent and thought that he walked without staggering and was not disoriented. The county's expert witness stated that there are no standards requiring an intoxicated person to be held in a separate cell. He stated that absent bizarre behavior or something unusual, there is no need to house an intoxicated person separately.
Cooney testified that shortly after he was placed in the cell with Hooks, Hooks said something to him, then grabbed him, pulled him off the bench on which he was sitting and into the toilet area, which is separated from the rest of the cell by a privacy partition, and sexually assaulted him. Cooney *611 testified that he resisted and asked Hooks to let him go, hollering, "Stop, please don't, stop." When interviewed shortly after the incident, however, Cooney said he had not called for help. He testified that he pulled up his pants after the assault and returned to the main area of the cell. He said that Hooks talked briefly with the other detainee, D.E., who had appeared to plaintiff to be asleep. Cooney testified that Hooks then said, "We're not done yet," after which he dragged Cooney back to the toilet area and anally penetrated him a second time. According to Cooney, Hooks also tried to force plaintiff to perform fellatio upon him.
It was at this point that a jailer, making a regular half-hour check, saw suspicious behavior when he looked through a window in the cell door, and entered the cell. The deputy testified that the time was 2:55 a.m., about 5 minutes after Cooney was placed in the cell.
Although a sexual assault examination at Hennepin County Medical Center was negative, the jury found that Hooks sexually assaulted Cooney, that Hennepin County was negligent in its detention of Cooney, that the negligence was a direct cause of injury to plaintiff, that plaintiff too was negligent during his detention and that plaintiff's conduct was also a direct cause of his injury. The jury determined that Hennepin County was 54.1% negligent and plaintiff was 45.9% negligent and found damages (for past and future medical expenses and past and future emotional distress) of $155,150.
The trial court awarded plaintiff judgment in the sum of $94,024.15 (including preverdict interest), together with costs and disbursements. Subsequently, however, the trial court granted Hennepin County's motion for judgment notwithstanding the verdict.
The existence of a legal duty is, of course, a matter of law, which the court must decide. Larson v. Larson, 373 N.W.2d 287, 289 (Minn.1985). Generally speaking, one does not have a duty to protect a person from intentional harm at the hands of another. Leaon v. Washington County, 397 N.W.2d 867, 873 (Minn.1986); Lundgren v. Fultz, 354 N.W.2d 25, 27 (Minn.1984). When, however, a person has custody of another under circumstances in which the other person is "deprived of normal opportunities of self protection," Harper v. Herman, 499 N.W.2d 472, 474 (Minn.1993), such a duty is imposed on the custodian because of the special relationship that exists between custodian and detainee. See Sylvester v. Northwestern Hosp. of Minneapolis, 236 Minn. 384, 53 N.W.2d 17 (1952). See also Restatement (Second) of Torts § 320 (1965). Most courts that have considered the question have concluded, and Hennepin County concedes, that the government has a general duty to exercise reasonable care to safeguard prisoners from attack by other prisoners. Relevant cases are collected at David A. Jones, Annotation, Liability of Prison Authorities for Injury to Prisoner Directly Caused by Assault by Other Prisoner, 41 A.L.R.3d 1021 (1972).
The jailer is not, however, a guarantor of the safety of a prisoner. Jones v. United States, 534 F.2d 53, 54 (5th Cir.1976), cert. denied, 429 U.S. 978, 97 S.Ct. 487, 50 L.Ed.2d 586. The jailer's duty to protect an inmate from violence arises when the jailer knows or, in the exercise of reasonable care, should know of the danger of attack. See, e.g., Saunders v. State, 446 A.2d 748, 751 (R.I.1982); Harris v. State, 61 N.J. 585, 297 A.2d 561, 564-65 (1972); Summers v. Horton, 443 F.2d 225, 226 (4th Cir.1971).
In deciding the motion for judgment notwithstanding the verdict, the trial court reasoned that although the county had a duty to exercise reasonable care with respect to the plaintiff, there was no evidence that the county had breached that duty. There was no evidence that Cooney appeared so impaired that he was likely to be a danger to himself or to others. There was nothing in Hooks' behavior prior to the assault of the plaintiff, nothing in the record of his prior bookings, and nothing about the misdemeanor for which Hooks was then detained, a nonviolent property crime, that could have reasonably been thought to put the county on notice of or to give the county any reason to anticipate Hooks' assaultive tendencies or a propensity toward violence.
*612 Citing Lundgren v. Fultz, 354 N.W.2d 25 (Minn.1984), Cooney contends that close questions of foreseeability are for the jury. As Justice Glenn Kelley subsequently noted, however, in Alholm v. Wilt, 394 N.W.2d 488, 491 n. 5 (Minn.1986):
[W]e are troubled by the practice of placing foreseeability within the jury's domain. The foreseeability issue, as a threshold issue, is more properly decided by the court prior to submitting the case to the jury. If the trial court concludes that the innkeeper did not have notice of the person's dangerous propensities, then it must find that the injury would not have been foreseeable to a reasonable innkeeper and thus, no duty to protect arose.
In short, on the evidence that there had not been a claim of sexual assault within the confines of the jail for at least 17 years and on the evidence that there was nothing in Hooks' record, in the pending charge of misdemeanor trespass, or in Hooks' present demeanor to suggest to a perceptive, careful person that Hooks presented any physical threat to anyone else, the trial court quite properly ruled that Hooks' assault on Cooney was unforeseeable to a reasonable jailer. The court of appeals agreed, as does this court.
Although society, including a person detained in the jail, is entitled to expect vigilance on the part of the jailer to maintain order in the jail and to protect the detainee from assault, neither society nor the detainee is entitled to expect prescience.
Affirmed.
