The man accused of attacking police with a machete near New York's Times Square on New Year's Eve was arrested on charges of attempting to kill officers.

The New York Police Department said in a release that Bickford was charged with two counts of assault on a police officer and one count of attempted assault on a police officer.

Police shot Bickford in the shoulder during the confrontation and he was hospitalized. It wasn't immediately clear if he had a lawyer who could speak to the allegations.

The violence happened about two hours before midnight on Saturday, just outside the area where revelers are screened for weapons before getting into one of the world's biggest and most famous New Year's celebrations.

The two officers were hit with a machete before the suspect was shot. Two officers were hospitalized, one with a fractured skull and the other with a bad cut, and were expected to make a full recovery. The suspect was also present.

Bickford is believed to have traveled to New York City earlier in the week, according to a law enforcement official. They are looking into the possibility that he went to Times Square to attack the police.

New York City police and federal officials are still trying to figure out a reason for Bickford's actions. The official spoke to The AP on the condition of anonymity.

According to the assistant director in charge of the FBI's New York field office, investigators think the attacker was alone.

Some people ran after the attack in Times Square.

That's right.

Eric Tucker in Washington, Michael Balsamo in Kansas City, Missouri, and Michael R. Sisak in New York contributed to the report.