The suspect was taken to a hospital with life-threatening injuries, while the third victim was in stable condition, police spokesman Joel DeSpain said.
The stabbings took place in one of a few apartments above a vacant office building on the main road through the state capital. Police blocked off a busy intersection, snarling traffic in the city for several hours. There appeared to be few witnesses, with a bar next to the building closed until evening.
DeSpain said police responding to a 911 call arrived about 1 p.m., and at least one of the responding officers shot the suspect. He did not say how many shots were fired or how many officers used their weapons.
One person died at the scene from stab wounds, and a second died at a hospital, he said.
DeSpain provided few details about what happened, other than to say it appeared to have been a dispute between neighbors.
"We just don't have any motive at this time," DeSpain said.
He declined to give ages or genders for those involved, saying the medical examiner had not yet identified the victims. He would not say whether any of the people were related.
A young child who was found hiding in the apartment wasn't injured, DeSpain said.
The state Division of Criminal Investigation will handle the shooting probe in light of a new law requiring an outside investigator to lead inquiries into all officer-involved shootings. Madison police will investigate the stabbings.