The incident happened at the Cumberland Street supermarket just before 2.30pm yesterday.
Police said three of the people injured in the attack are in a serious but stable condition in hospital. A fourth person is in a moderate condition.
They said the man was released from hospital last night and moved to Dunedin Central Police Station.
He is due to appear in the Dunedin District Court today.