King's Shield by Sherwood Smith Book Three of Inda

In the third book of the Inda quartet, Inda, on the verge of adulthood, is at last coming home. His best friend from his academy days, E vred, is now king. But instead of befriending and welcoming Inda, he puts him in charge of defending the kingdom. In saving his homeland from attack, Inda must prove himself-or lose everything he holds dear.