When officer John-Paul Dorais of the Meriden Police Department stumbled upon a homeless woman sleeping in a shed, he couldn't turn a blind eye.
"I sympathized with her," Dorais told The Huffington Post. "She was well-educated, well-spoken, she was just going through a really difficult time."
Dorais and his partner officer Jeff Witkin tried to find a shelter to take the woman in, but were turned away.
So Dorais took matters into his own hands.
"We exhausted all our other options," Dorais said. "That's when I turned to Jeff and said 'What could it really cost us to buy her a motel room?'"
Witkin agreed and the partners headed to a local Comfort Inn & Suites.
During booking, Witkin snapped a photo of Dorais and posted it to the department's Facebook page.
"Officer Dorais's act of kindness exemplifies what the men and women of the Meriden Police Department stand for and we are proud of him and all our officers who do these kinds of deeds that are seldom recognized," the post reads.
The post ended up going viral, which surprised Dorais.
"Police officers do tons of great things that people don't know about all the time," Dorais said. "I've seen officers do bigger and better things than what we did. Really it was small in comparison."
Related: Police killed in the line of duty:
Police Killed in the line of duty 2015
Police officer pays for hotel room for homeless woman
This is an undated image released by the Hayward Police Department shows Sgt. Scott Lunger. Lunger was shot and killed during an early morning traffic stop Wednesday, July 22, 2015, and authorities say the shooter has not been arrested. Lunger was shot about 3:15 a.m. after he stopped a white Chevrolet pickup that was swerving on the road and driving erratically. (AP Photo/Hayward Police Department)
This undated photo provided by the San Jose Police Department shows San Jose Police Officer Michael Johnson. Johnson was fatally shot by Scott Dunham on Tuesday, March 24, 2015, launching an hourslong manhunt. The search ended when Dunham was found dead early Wednesday on his apartment balcony, San Jose police spokesman Albert Morales said. (AP Photo/San Jose Police Department)
In this undated photo provided by the Okaloosa Sheriff's Office, shows Deputy Bill Myers. Authorities say Myers was killed by Joel Dixon Smith as Myers was serving a domestic violence injunction at a law office in Shalimar, Fla., Tuesday, Sept. 22, 2015. (Okaloosa Sheriff's Office via AP)
This undated photo provided by the Coeur d'Alene Police Department shows Coeur d'Alene, police officer Greg Moore, who was critically wounded in the line of duty in the early morning of Tuesday, May 5, 2015. The northern Idaho officer is in critical condition after being shot and a suspect is in custody. (Coeur d'Alene Police Department via AP)
Members of the Kentucky State Police Honor Guard prepare to remove the coffin carrying the remains of slain Kentucky state trooper Joseph Cameron Ponder from a horse-drawn caisson to the service at the Kentucky Veterans Cemetery in Radcliff, Ky., Friday, Sept. 18, 2015. Ponder, a decorated Navy veteran, had been on the state police force less than a year when he was fatally shot Sunday night in western Kentucky. (AP Photo/Timothy D. Easley)
In this frame grab from video, Channing Wells speaks at the funeral service of her husband, U.S. Deputy Marshal Josie Wells, Tuesday, March 17, 2015, at Wade Baptist Church in Moss Point, Miss. The 27-year-old Wells was killed in a shootout last week near Baton Rouge, La., while he and other law enforcement officers were trying to arrest a man suspected of killing two people outside a local nightclub. (AP Photo/WLOX, Pat Gibson, Pool)
This undated photo provided by the Sunset, La., Police Department shows Officer Henry Nelson. Nelson was fatally shot Wednesday, Aug. 26, 2015, when he responded to a call from a house where three women had been stabbed in Sunset. (Courtesy of the Sunset Police Department/KLFY via AP)
In this frame from video provided by KPLC, state police chief Mike Edmonson, right, stands with Robert Ledoux, the good Samaritan who helped capture a man accused of shooting a state trooper, Monday, Aug. 24, 2015, in Lake Charles, La. Kevin Daigle is accused of shooting Senior Trooper Steven Vincent on Sunday evening when Vincent found Daigle's truck in a ditch. (KPLC via AP) MANDATORY CREDIT; LOCAL MEDIA OUT; AMERICAN PRESS OUT
In this photo provided by the Louisiana State Police, Grover Cannon, suspected in the killing of Shreveport Police Officer Thomas LaValley, sits in custody in Shreveport, La., Thursday, Aug. 6, 2015. Cannon was taken into custody after a round-the-clock manhunt following the Wednesday shooting. (Tom Madden/Louisiana State Police via AP)
Louisiana State Police talk to people on a porch as they search for an escaped prisoner who shot and killed a New Orleans police officer in his vehicle while he was transporting the prisoner in New Orleans, Saturday, June 20, 2015. The New Orleans Police Department said Officer Daryle Holloway was shot while transporting Travis Boys, who managed to get his handcuffed hands from behind his back to the front, grab a firearm and shoot the officer. A manhunt was underway for the 33-year-old Boys, according to Police Chief Michael Harrison. (AP Photo/Gerald Herbert)
This undated photo released by the Hattiesburg Police Department, shows Officer Benjamin Deen in Hattiesburg, Miss. Officer Deen and Officer Liquori Tate were fatally shot during a traffic stop, Saturday evening, May 9, 2015, in the southern Mississippi city of Hattiesburg, authorities said. A law enforcement official says three people have been arrested and two of them have been charged with capital murder in the fatal shootings of the two Mississippi police officers. (Hattiesburg Police Department via AP)
This undated photo released by the Hattiesburg Police Department, shows Officer Liquori Tate in Hattiesburg, Miss. Officer Tate and Officer Benjamin Deen were fatally shot during a traffic stop, Saturday evening, May 9, 2015, in the southern Mississippi city of Hattiesburg, prompting a statewide manhunt early Sunday for two suspects, authorities said. (Hattiesburg Police Department via AP)
This photo provided by the Omaha Police Department shows officer Kerrie Orozco. A suspect being sought by police for an Omaha shooting opened fire on officers Wednesday, May 20, 2015, promoting a shootout that left Orozco and the suspect dead, according to Police Chief Todd Schmaderer. (Omaha Police Department via AP)
This undated photo provided by the Carson City, Nev., Sheriff's Office shows Deputy Carl Howell. Howell was killed early Saturday, Aug. 15, 2015, in a shootout during a domestic violence call in Carson City. The suspect also died.(AP Photo/Carson City Sheriff's Office via AP)
This undated file photo provided by the Albuquerque, N.M., Police Department shows Officer Dan Webster. Webster, shot during a traffic stop on Oct. 21, 2015, died early Thursday, Oct. 29, Albuquerque police said. Chief Gorden Eden, Jr. said in a statement that Officer Daniel Webster died at 2:30 a.m. Thursday. He had served on the police force for nearly nine years. Webster suffered gunshot wounds to his upper body and jaw on the night of Oct. 21 after Davon Lymon, 34, opened fire outside a pharmacy and fled, police said.(Albuquerque Police Department via AP, File)
This undated photo provided by the Rio Rancho Police Department shows Officer Gregg Benner. The officer was shot and killed during a traffic stop on Monday, May 25, 2015, in Rio Rancho, N.M. (Rio Rancho Police Department via AP)
FILE - This undated photo released by the New York City Police Department shows officer Brian Moore. Demetrius Blackwell, 35, who was arrested after a manhunt that followed the May 2 shooting of Moore, has been indicted on first-degree murder and other charges. Queens District Attorney Richard Brown said Thursday, June 11, 2015 that a grand jury returned a 12-count indictment in Moore's shooting and death. (New York City Police Department via AP, File)
A photo, date not known, provided by the New York Police Department shows police Officer Randolph Holder, who police said died after being shot in the head in a gun battle while pursuing a suspect Tuesday, Oct. 20, 2015, in New York following a report of shots fired. (New York Police Department via AP)
This undated photo released by the Cincinnati Police Department, shows Officer Sonny Kim. Kim, a decorated 27-year veteran of the Cincinnati Police Department, died along with a suspect while responding to a 911 call about an erratic armed man shortly before 9:30 a.m. in the Madisonville neighborhood, Police Chief Jeffrey Blackwell said. Both died at a Cincinnati hospital. (Cincinnati Police Department via AP)
This undated photo provided by Philadelphia Police Department, shows Robert Wilson III. Wilson, a Philadelphia police officer, was shot in the head and killed after he and his partner exchanged gunfire with two suspects trying to rob a video game store, city officials said Thursday, March 5, 2015. (AP Photo/Philadelphia Police Department)
This undated photo provided by the Richland County, S.C.,Sheriff's Office, shows Officer Greg Alia. Alia was fatally shot in the Richland Mall Wednesday, Sept. 30, 2015, in Forest Acres, S.C. Police say a suspect is in custody. (Richland County Sheriff's Office via AP)
FILE - This undated file photo released by the Memphis Police Department shows Officer Sean Bolton, who was fatally shot during a traffic stop, Aug. 1, 2015, in Memphis, Tenn. The memorial and visitation Wednesday, Aug. 5 will be followed by a funeral service and burial on Thursday for the 33-year-old Bolton. (Memphis Police Department via AP, File)
This undated photo provided by the Harris County Sheriff's Office shows sheriff's deputy Darren Goforth who was fatally shot Friday, Aug. 28, 2015. Goforth, was pumping gas into his vehicle when a man approached him from behind and fired multiple shots, Harris County Sheriff's Office spokesman Ryan Sullivan told The Associated Press. (Harris County Sheriff's Office via AP)
In this photo provided by Wisconsin Department of Transportation/Division of State Patrol is Wisconsin State Patrol trooper Trevor Casper, 21. Casper, just three months out of the academy and working his "dream job," died Tuesday, March 24, 2015 in a shootout with a bank robbery suspect also believed to have killed another motorist in Fond Du Lac, Wis. (AP Photo/Department of Transportation/Division of State Patrol)