Spanish police say a Madrid subway train has been evacuated following a dispute between two passengers, one of whom allegedly fired a blank from a starting pistol.

The lunchtime incident happened as the train was between stations in a residential area on Thursday and caused commotion among other passengers.

Heavily armed police were immediately deployed to the scene. The National Police says the two passengers were arrested and no one was injured.

Police say that after an argument broke out between the two passengers, one fired the blank shot from the pistol and the other brandished a knife.

Authorities say the incident was not terrorism-related.

The private Europa Press news agency says the incident caused moments of panic and that a passenger pulled an emergency brake to halt the train.