West Midlands Police said its officers received "slash injuries" which are not thought to be serious, however they were taken to hospital for further checks.
The force has arrested two men, aged 41 and 37, and a 31-year-old woman on suspicion of attempted murder.
The injured officers had been on patrol in West Bromwich after police were given extra powers to carry out additional stop checks, following an increase in violence in recent days.
The officers spotted the men acting suspiciously and once they approached them, the men became aggressive and attacked them, said the force.
Chief Superintendent Ian Green, from Sandwell Police, said: "Fortunately both officers received minor injuries but are understandably shaken by today’s incident as I’m sure other officers and staff are, as well as our communities.
"We had special powers authorised to carry out additional patrols in West Bromwich town centre as a result of an increase in violence in recent days, as our priority is keeping you safe.
"We continue to keep doing all we can to reassure our communities and stop people who think it’s acceptable to carry weapons, or use them.
"There will be increased patrols in the area and the Section 60 powers will be continuing until 10pm this evening. We’ll share the details later on social media.
"A CCTV trawl is being carried out and a number of witnesses are being spoken to.
"We will support our colleagues throughout their recovery - and others affected by what has happened this morning - and the pending investigation."
Witnesses said they saw the police officers with neck injuries and wearing bandages following the attack.
Bobbie Adams told the Express & Star: "There were a few people standing round Hungry Horse talking about what had happened, and then we heard an officer shout can we make space for the paramedics.
"We saw the officer walk down with his head bandaged and everyone moved aside and everyone just started clapping."
West Midlands Ambulance service described the officers' injuries as "non-serious".
West Bromwich East MP, Nicola Richards, said more needs to be done to make the town safe.
"A Section 60 dispersal order has now been authorised in the town, meaning that the Police can ask any person to leave the town if they believe that they are at risk of carrying out a crime. The Police have also stepped up patrols in the area as a result of the incident.
"I’m in communication with the BID, New Square Management, and the Police about this horrific incident. But I’ve been clear, we all need to do more to make our town safe once again. So that we can welcome back visitors and make West Brom the best place to shop, work, and live."
Anyone with information should contact West Midlands Police via live chat on its website or call on 101.