The town's police chief, Joseph Zikuski, told a news conference that 14 people had been found dead in the American Civic Association (ACA) buildings.
The man believed to have carried out the attack was found dead with an apparently self-inflicted gunshot wound, he said. Ammunition, two more hand guns and a hunting knife were recovered from the scene.
Democratic Congressman Maurice Hinchey told AP the gunman had entered a room where people were sitting exams for US citizenship.
"It was in the middle of a test. He just went in and opened fire," said Mr Hinchey, whose congressional district includes Binghamton.
The BBC's Matthew Price in Binghamton says people in the town are struggling to deal with the horror of what some have described as an "unbelievable" attack.
Witnesses reported seeing a man entering the ACA building during the morning. He was described as being of Asian appearance, in his 20s, and wearing a bright green nylon jacket and dark-rimmed glasses.
The gunman, believed to have been a Vietnamese-American, used his car to barricade the building's back door before bursting in the front door, firing his weapon, said officials.
Jon Donnison, BBC News, Binghamton
Binghamton is the latest American town trying to come to terms with a mass shooting. Last week it was Carthage, North Carolina. The week before Samson, Alabama.
With the red and blue lights of police cars flashing through the drizzle, smokers huddle in doorways on Main Street. There is only one topic of conversation. "It's a very good area, I would never think that it would happen here," said Martine Youmans.
The words and the scenes are increasingly familiar for Americans. On local talk radio stations the chatter has already turned to gun law, still as divisive an issue as ever. One caller's plea: "Don't let them take away our guns."
He shot two receptionists, one of whom managed to call the police, before walking down a corridor towards classrooms.
Police were on the scene in minutes - people in nearby apartments, a school and a care home were told to stay in their buildings and some streets were sealed off.
Mr Zikuski said 26 people took refuge in the building's basement after hearing gunshots.
Eyewitnesses described seeing some people fleeing the building.
"About 15 or so employees of the Civic Association came out crying with their hands behind their heads," one witness told Binghamton's WNBF Radio.
"They were escorted by the police and they took them to ambulances and took them away," he said.
Two other people were seen being led away by police in plastic handcuffs during the incident but officials later said they were not suspects.
Police later raided the home of the suspected gunman and removed items including computer hard drives and a rifle bag, reports said.
Local hospitals have said about 30 people are being treated.
RECENT US SHOOTINGS
A gunman kills a total of 11 people in a series of shootings southern Alabama
A gunman dressed as Santa Claus kills nine people and himself on Christmas Eve in LA
Six people die in a series of shootings in the north-west of Washington state
A worker at a plastics plant in Kentucky kills five people before killing himself
32 people and the gunman die at the Virginia Tech campus
A spokeswoman for Our Lady of Lourdes hospital told the BBC several people had been admitted with serious injuries.
The governor of New York state, David Paterson, said it had been "a tragic day for New York".
"This is a horrible situation. There's actually no reason or excuse for this kind of shooting and brutal attack on innocent people right here in New York state," he said.
Mr Paterson told a news conference there was "a profound sense of outrage at this senseless act of violence in which many innocent people were killed, injured and probably traumatised for some time to come".
He said many of the victims were not from the US and police were in the process of contacting their families living abroad.
New York State would offer any assistance to the victims, who had "wanted to be part of the American dream and so tragically may have had that hope thwarted today", said Mr Paterson.
"There still is an American dream and all of us who are Americans will try to heal this very, very deep wound in the city of Binghamton."
Our correspondent said police were picking through evidence in the building trying to determine what had happened and why.
Bob Joseph of WNBF Radio told the BBC the town had never experienced an incident on such a scale before.
The ACA says on its website that it assists immigrants and refugees with personal and immigration counselling.
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.