Unexpected result in an integral calculation

Hello everyone, I’m new to Mathematica and trying to solve an integral. Although I solve it by hand and using Matlab it gives me the correct answer, when I try to solve it using Mathematica it gives me the correct answer, but with a wrong condition.

More specifically,

Integrate[Exp[-x^2] x^(1 - a), {x, 0, Infinity}]

gives the following answer. The answer is right for every a and not for only if Re[a]<2.

1/2 Gamma[1 - a/2] if Re[a]<2

What should I do to avoid this issue?
Thanks in advance:)

Does this also holds for all a, complex and negative and so on?

Excuse me, I didn’t mention that this holds for all positive Re[a]

I think that the integral does not converge for x>=2 even if you integrate just from 0 to 1.

The condition is correct. If a>=2 then there is a non-integrable singularity at the origin.