In 1807 Lobachevskii graduated from the Gymnasium and entered Kazan University as a free student. Kazan State University had been founded in 1804, the result of one of the many reforms of the emperor Alexander I, and it opened in the following year, only two years before Lobachevskii began his undergraduate career. His original intention was to study medicine but he changed to study a broad scientific course involving mathematics and physics. Vinberg writes :-
In the first years the atmosphere in the Department was quite favourable. The students were full of enthusiasm. They studied day and night to compensate for lack of knowledge. The professors, mainly invited from Germany, turned out to be excellent teachers, which was not common. Lobachevskii was highly successful in all courses he took ...One of the excellent professors who had been invited from Germany was Martin Bartels (1769 - 1833) who had been appointed as Professor of Mathematics. Bartels was a school teacher and friend of Gauss, and the two corresponded. We shall return later to discuss ideas of some historians, for example M Kline, that Gauss may have given Lobachevskii hints regarding directions that he might take in his mathematical work through the letters exchanged between Bartels and Gauss. A skilled teacher, Bartels soon interested Lobachevskii in mathematics. We do know that Bartels lectured on the history of mathematics and that he gave a course based on the text by Montucla. Since Euclid's Elements and his theory of parallel lines are discussed in detail in Montucla's book, it seems likely that Lobachevskii's interest in the Fifth Postulate was stimulated by these lectures. Laptev, see , has established that Lobachevskii attended this history course given by Bartels.
Lobachevskii received a Master's Degree in physics and mathematics in 1811. In 1814 he was appointed to a lectureship and in 1816 he became an extraordinary professor. In 1822 he was appointed as a full professor :-
... the same year in which he began an administrative career as a member of the committee formed to supervise the construction of new university buildings.Lobachevskii had experienced difficulties during this period at the University of Kazan. Struik writes in  that the administration, led by the curator M L Magnitskii:-
... reflected the spirit of the later years of Tsar Alexander I, who was distrustful of modern science and philosophy, particularly that of the German philosopher Immanuel Kant, as evil products of the French Revolution and a menace to orthodox religion. The results at Kazan during the years 1819-26 were factionalism, decay of academic standards, dismissals, and departure of some of the best professors, including ... Bartels ...Despite these difficulties, many brought on according to Vinberg in  by Lobachevskii's "upright and independent character", he achieved many things. As well as his vigorous mathematical research, which we shall talk about later in this article, he taught a wide range of topics including mathematics, physics and astronomy. His lectures :-
... were detailed and clear, so that they could be understood even by poorly prepared students.Lobachevskii bought equipment for the physics laboratory, and he purchased books for the library in St Petersburg. He was appointed to important positions within the university such as the dean of the Mathematics and Physics Department between 1820 and 1825 and head librarian from 1825 to 1835. He also served as Head of the Observatory and was clearly strongly influencing policy within the University. However :-
... the clashes with the curator [Magnitskii] continued.In 1826 Tsar Nicholas I became ruler and introduced a more tolerant regime. In that year Magnitskii was dismissed as curator of Kazan University and a new curator M N Musin-Pushkin was appointed. The atmosphere now changed markedly and Musin-Pushkin found in Lobachevskii someone who could work with him in bringing important changes to the university. In 1827 Lobachevskii became rector of Kazan University, a post he was to hold for the next 19 years. The following year he made a speech (which was published in 1832) On the most important subjects of education and this gives clearly what were the ideas in his educational philosophy. Laptev writes in that Lobachevskii :-
... outlined the ideal of the harmonious development of the personality, emphasised the social significance of upbringing and education, and discussed the role of the sciences and the scientist's duty to his country and people.The University of Kazan flourished while Lobachevskii was rector, and this was largely due to his influence. There was a vigorous programme of new building with a library, an astronomical observatory, new medical facilities, and physics, chemistry, and anatomy laboratories being constructed. He pressed strongly for higher levels of scientific research and he equally encouraged research in the arts, particularly developing a leading centre for Oriental Studies. There was a marked increase in the number of students and Lobachevskii invested much effort in raising not only the standards of education in the university, but also in the local schools.
Two natural disasters struck the university while he was Rector of Kazan :-
... a cholera epidemic in 1830 and a big fire in 1842. Owing to resolute and reasonable measures taken by Lobachevskii the damage to the University was reduced to a minimum. for his activity during the cholera epidemic Lobachevskii received a message of thanks from the Emperor.The book  contains some yearly reports Lobachevskii wrote as rector of Kazan University. Those published are only a small sample taken from the hundreds of pages of manuscript:-
... written in [Lobachevskii's] full, firm hand, with hardly an error, let alone a crossing-out, reports which were an obstacle to real work in the path of all academics then as now.Despite this heavy administrative load, Lobachevskii continued to teach a variety of different topics such as mechanics, hydrodynamics, integration, differential equations, the calculus of variations, and mathematical physics. He even found time to give lectures on physics to the general public during the years 1838 to 1840 but the heavy work-load was to eventually take its toll on his health.
In 1832 Lobachevskii married Lady Varvara Alexivna Moisieva who came from a wealthy family. At the time of his marriage his wife was a young girl while Lobachevskii was forty years old. The marriage gave them seven children and it is claimed in  that the children:-
... and the cost of technological improvements for his estate left him with little money upon his retirement.In  Vinberg writes:-
The couple lived in a big three-storey house and received a lot of guests with lavish hospitality. However Lobachevskii was not lucky in his marriage.After Lobachevskii retired in 1846 (essentially dismissed by the University of Kazan), his health rapidly deteriorated. Matveev, in his article , quotes many records concerning Lobachevskii's estate which he purchased at Slobodka. There are many claims by biographers that:-
Lobachevskii was an impractical manager who jeopardised his financial position by purchasing the estate while living on a pension; that he had no time to look after the estate and took little interest in it; that he was left in poverty and ignored by the local officials, etc.but Matveev shows that these claims are totally unjustified. Soon after he retired, however, his favourite eldest son died and Lobachevskii was hit hard by this tragedy. The illness was he suffered from became progressively worse and led to blindness. These and financial difficulties added to the heavy burdens he had to bear over his last years. His great mathematical achievements, which we shall now discuss, were not recognised in his lifetime and he died without having any notion of the fame and importance that his work would achieve.
Since Euclid's axiomatic formulation of geometry mathematicians had been trying to prove his fifth postulate as a theorem deduced from the other four axioms. The fifth postulate states that given a line and a point not on the line, a unique line can be drawn through the point parallel to the given line. Lobachevskii did not try to prove this postulate as a theorem. Instead he studied geometry in which the fifth postulate does not necessarily hold. Lobachevskii categorised euclidean as a special case of this more general geometry.
His major work, Geometriya completed in 1823, was not published in its original form until 1909. On 11 February 1826, in the session of the Department of Physico-Mathematical Sciences at Kazan University, Lobachevskii requested that his work about a new geometry was heard and his paper A concise outline of the foundations of geometry was sent to referees. The text of this paper has not survived but the ideas were incorporated, perhaps in a modified form, in Lobachevskii's first publication on hyperbolic geometry. He published this work on non-euclidean geometry, the first account of the subject to appear in print, in 1929. It was published in the Kazan Messenger but rejected by Ostrogradski when it was submitted for publication in the St Petersburg Academy of Sciences.
In 1834 Lobachevskii found a method for the approximation of the roots of algebraic equations. This method of numerical solution of algebraic equations, developed independently by Gräffe to answer a prize question of the Berlin Academy of Sciences, is today a particularly suitable for methods for using computers to solve such problems. This method is today called the Dandelin-Gräffe method since Dandelin also independently investigated it, but only in Russia does the method appear to be named after Lobachevskii who is the third independent discoverer. See  for a discussion of the method and its three discoverers.
In 1837 Lobachevskii published his article Géométrie imaginaire and a summary of his new geometry Geometrische Untersuchungen zur Theorie der Parellellinien was published in Berlin in 1840. This last publication greatly impressed Gauss but much has been written about Gauss's role in the discovery of non-euclidean geometry which is just simply false. There is a coincidence which arises from the fact that we know that Gauss himself discovered non-euclidean geometry but told very few people, only his closest friends. Two of his friends were Farkas Bolyai, the father of János Bolyai (an independent discoverer of non-euclidean geometry), and Bartels who was Lobachevskii's teacher. This coincidence has prompted speculation that both Lobachevskii and Bolyai were led to their discoveries by Gauss. M Kline has put forward this theory but it has been refuted in several works; see for example . Also Laptev in  has examined the correspondence between Bartels and Gauss and shown that Bartels did not know about Gauss's results in non-euclidean geometry.
There are other claims made about Lobachevskii and the discovery of non-euclidean geometry which have been recently refuted. For example in  the claims that Lobachevskii was in correspondence with Gauss ( Gauss appreciated Lobachevskii's works very highly but had no personal correspondence with him), that Gauss studied Russian to read Lobachevskii's Russian papers as claimed for example in  (actually, Gauss had studied Russian before he had even heard of Lobachevskii), and that Gauss was a "good propagandist" of Lobachevskii's works in Germany (Gauss never commented publicly on Lobachevskii's work) are shown to be false.
The story of how Lobachevskii's hyperbolic geometry came to be accepted is a complex one and this biography is not the place in which to go into details, but we shall note the main events. In 1866, ten years after Lobachevskii's death, Geometrische Untersuchungen together with some of Gauss's correspondence on non-euclidean geometry. Beltrami, in 1868, gave a concrete realisation of Lobachevskii's geometry. Weierstrass led a seminar on Lobachevskii's geometry in 1870 which was attended by Klein and, two years later, after Klein and Lie had discussed these new generalisations of geometry in Paris, Klein produced his general view of geometry as the properties invariant under the action of some group of transformations in the Erlanger Programm. There were two further major contributions to Lobachevskii's geometry by Poincaré in 1882 and 1887. Perhaps these finally mark the acceptance of Lobachevskii's ideas which would eventually be seen as vital steps in freeing the thinking of mathematicians so that relativity theory had a natural mathematical foundation.