A semiconductor device is formed by a first layer 32 composed of AlGaN, a second layer 42 composed of GaN, a gate electrode 34, a source electrode 38, and a drain electrode 28. The first layer 32 has a region 32a formed between the gate electrode 34 and the second layer 42. A channel is formed in the vicinity of the boundary 24 of the first layer 32 and the second layer 42. The second layer 42 has p-type conductivity and is in contact with the source electrode 38.
When electrons flow in the channel, the electrons collide with surrounding atoms, and holes are formed. If holes are accumulated inside the semiconductor device, the presence of the accumulated holes causes dielectric breakdown. In the semiconductor device of the invention, holes are discharged to the outside of the device thorough the second layer 42 and the source electrode 38, and accumulation of holes can be prevented.