Factory security personnel restrained the suspect inside the plant and handed him over to police, who arrested him without any resistance, authorities said.
While the victims, two 44-year-old men, later died from their injuries.
The police reported in Twitter that there were no more injuries. The motive for the attack is being investigated.
Mercedes-Benz confirmed in a statement that two people were killed and that both the victims and the suspect were employees of a third-party provider.