<p>A semiconductor device includes a substrate formed of AlxGa1-xN (0<x<1) and a first semiconductor layer provided on the substrate and formed of a III-group nitride semiconductor containing Al. The difference between an Al ratio of the substrate and an Al ratio of the first semiconductor layer is less than about 0.15. <IMAGE></p>