A cancer patient opened fire inside a Manhattan hospital on Thursday night before barricading himself in a bathroom for several hours, sources and police said.

The 65-year-old man fired five or six shots inside Memorial Sloan Kettering’s urgent care facility on East 67th Street at about 8:45 p.m., law enforcement sources said.

The man, who was released from the hospital Thursday, was taken into custody just before midnight, police said.

No injuries were immediately reported, police said.

US CAPITOL POLICE OFFICER DEAD FOLLOWING INJURIES SUFFERED DURING RIOT

The shooting sparked a massive police response, with the NYPD’s hostage negotiation and emergency service units on hand.

It was not immediately clear if the man held any hostages during the standoff.

PORTLAND RIOTERS SMASH COURTHOUSE WINDOW, DAMAGE BUSINESSES BEFORE POLICE DECLARE UNLAWFUL ASSEMBLY 

The department’s 19th Precinct had urged the public to avoid the area.

"There is an active police investigation occurring inside Sloan Kettering Hospital located at 425 E 67 Street," the precinct tweeted.

CLICK HERE TO GET THE FOX NEWS APP

"Please avoid the area & expect a large police presence."