A man has been arrested after he tried to drag a police guard from his car outside the Austrian parliament building.

Vienna police said the incident took place shortly after 8am, when the 26-year-old suspect, an Afghan national, spoke to the officer in his patrol car, then grabbed his clothes and tried to pull him out of the vehicle.

The officer used pepper spray to deter the assailant, injuring him slightly. Police say the officer was unhurt, and no weapons were found on the suspect.

The incident comes after a knife attack on Sunday night on an Austrian soldier who was guarding the Iranian ambassador’s residence in Vienna.

The attacker in that case, an Austrian national, was shot dead, and senior national security official Michaela Kardeis said that he “clearly had sympathy for political Islam”.

The man’s Vienna flat was searched on Monday, and Ms Kardeis said investigators are evaluating items such as a computer and mobile phone that they seized.

She added that she had taken care not to say that he was a jihadi or radicalised “but that simply out of his interest in surfing — which has not yet been evaluated in detail — there is … a certain sympathy”.