A semiconductor device (10, 20), comprising: an epitaxial substrate (10A, 20A), a source electrode, a drain electrode and a gate electrode, said epitaxial substrate (10A, 20A) comprising in this order: a base substrate; a channel layer formed of a first group III nitride containing at least Ga and having a composition of In x1 Al y1 Ga z1 N, with x1+y1+z1=1; and a barrier layer, the barrier layer being formed of a second group III nitride containing at least In and Al and having a composition of In x2 Al y2 Ga z2 N, with x2+y2+z2=1, wherein: said barrier layer consists in a near-surface portion and a base portion, wherein said near-surface portion is formed on said base portion so as to be at the surface of said barrier layer; said near-surface portion is a portion in a range where the depth is less than a distance d1 from the surface of said barrier layer, wherein the distance d1 is 6nm or more; an In composition ratio of the surface of said barrier layer is larger than an In composition ratio of said base portion; and 1.05≤x2β/x2α≤1.1 where the composition of said second group III nitride in said base portion is represented by In x2α Al y2α Ga z2α N, with x2α+y2α+z2α=1, and the composition of said second group III nitride in said near-surface portion at the surface of the barrier layer is represented by In x2β Al y2β Ga z2β N, with x2β+y2β+z2β=1, wherein said source electrode, said drain electrode and said gate electrode are provided on the barrier layer of said epitaxial substrate (10A, 20A). an epitaxial substrate (10A, 20A), a source electrode, a drain electrode and a gate electrode, said epitaxial substrate (10A, 20A) comprising in this order: a base substrate; a channel layer formed of a first group III nitride containing at least Ga and having a composition of In x1 Al y1 Ga z1 N, with x1+y1+z1=1; and a barrier layer, the barrier layer being formed of a second group III nitride containing at least In and Al and having a composition of In x2 Al y2 Ga z2 N, with x2+y2+z2=1, wherein: said barrier layer consists in a near-surface portion and a base portion, wherein said near-surface portion is formed on said base portion so as to be at the surface of said barrier layer; said near-surface portion is a portion in a range where the depth is less than a distance d1 from the surface of said barrier layer, wherein the distance d1 is 6nm or more; an In composition ratio of the surface of said barrier layer is larger than an In composition ratio of said base portion; and 1.05≤x2β/x2α≤1.1 where the composition of said second group III nitride in said base portion is represented by In x2α Al y2α Ga z2α N, with x2α+y2α+z2α=1, and the composition of said second group III nitride in said near-surface portion at the surface of the barrier layer is represented by In x2β Al y2β Ga z2β N, with x2β+y2β+z2β=1, wherein said source electrode, said drain electrode and said gate electrode are provided on the barrier layer of said epitaxial substrate (10A, 20A). a base substrate; a channel layer formed of a first group III nitride containing at least Ga and having a composition of In x1 Al y1 Ga z1 N, with x1+y1+z1=1; and a barrier layer, the barrier layer being formed of a second group III nitride containing at least In and Al and having a composition of In x2 Al y2 Ga z2 N, with x2+y2+z2=1, wherein: said barrier layer consists in a near-surface portion and a base portion, wherein said near-surface portion is formed on said base portion so as to be at the surface of said barrier layer; said near-surface portion is a portion in a range where the depth is less than a distance d1 from the surface of said barrier layer, wherein the distance d1 is 6nm or more; an In composition ratio of the surface of said barrier layer is larger than an In composition ratio of said base portion; and 1.05≤x2β/x2α≤1.1 where the composition of said second group III nitride in said base portion is represented by In x2α Al y2α Ga z2α N, with x2α+y2α+z2α=1, and the composition of said second group III nitride in said near-surface portion at the surface of the barrier layer is represented by In x2β Al y2β Ga z2β N, with x2β+y2β+z2β=1, wherein said source electrode, said drain electrode and said gate electrode are provided on the barrier layer of said epitaxial substrate (10A, 20A). said barrier layer consists in a near-surface portion and a base portion, wherein said near-surface portion is formed on said base portion so as to be at the surface of said barrier layer; said near-surface portion is a portion in a range where the depth is less than a distance d1 from the surface of said barrier layer, wherein the distance d1 is 6nm or more; an In composition ratio of the surface of said barrier layer is larger than an In composition ratio of said base portion; and 1.05≤x2β/x2α≤1.1 where the composition of said second group III nitride in said base portion is represented by In x2α Al y2α Ga z2α N, with x2α+y2α+z2α=1, and the composition of said second group III nitride in said near-surface portion at the surface of the barrier layer is represented by In x2β Al y2β Ga z2β N, with x2β+y2β+z2β=1, wherein said source electrode, said drain electrode and said gate electrode are provided on the barrier layer of said epitaxial substrate (10A, 20A).