Yemen's prime minister and parliament speaker were wounded as shelling hit a mosque in the presidential compound on Friday, the ruling party spokesman told AFP.