Hospital treatment is free to people classed as 'ordinarily resident' in the UK. This is not dependent on nationality, payment of UK taxes, National Insurance (NI) contributions, being registered with a GP, having an NHS Number or owning property in the UK.
To be considered ordinarily resident, and entitled to free hospital treatment, you must be living in the UK on a lawful and properly settled basis for the time being – you may be asked to prove this.
Non-EEA nationals who are subject to immigration control are not classed as ordinarily resident unless they have indefinite leave to remain.
Visit How to access NHS services in England for more information.