Three soldiers were killed in the suicide bombing in Aden and several others wounded, the Middle East News Agency reported.
Al-Qaida in the Arabian Peninsula is believed to be responsible for the attack, officials said. In what appeared to be coordinated attacks, rockets were fired at two police stations in Aden without causing any injuries.
Security forces described the two men detained at the security headquarters as "terrorist elements." They were being questioned.
Late Monday, two bombs placed in different locations under the pipeline between the Ayadh oil field and the Nushaima terminal on the Gulf of Aden exploded. The pipeline, which normally carries around 10,000 barrels a day, was shut down.