Can you get a Mathematics PhD if you're an engineer? I'm a Software Engineering and Mathematics student. And I'll probably get my engineering degree much sooner than my Maths degree (I'm not sure I'll get it, but I'll try, as Eng. takes a lot of time off my day).

So, my question is pretty simple: Can an engineer get a Maths doctorate?

For further details, my engineering course has pretty basic maths stuff: Calculus, a bit of logic, introductory number theory, graph theory, some numerical analysis, etc.

However, I'm enrolled in a pure maths course which covers pretty 'advanced' stuff, will it matter that I passed these subjects even if I don't get my math degree?

E: Please consider reopening this question, I've added details that may be relevant to this particular scenario.
The title of your degree does not matter as much as the courses you have taken. If you have taken several upper-level courses, have convincing letters from mathematics faculty, and demonstrate your interest in mathematics in general, you have every chance of getting into a doctoral program in mathematics. 

However, if you finish undergrad with only the minimum of math courses required for your engineering degree, and then apply for a math doctoral program, admissions committees will not look fondly on that. Then you might have to supplement your math background in some other way. 

This also applies to people with math degrees that are not particularly deep. In the end it's the experience you have had with mathematics that counts, not the particular title of your major/degree.