Brandt's definition of groupoids (1926) The definition of a category is usually attributed to Mac Lane and Eilenberg (1945). What seems to be less known is that the german mathematician Heinrich Brandt has developed the notion of a groupoid already in 1926 (motivated by questions on quadratic forms). The paper "Über eine Verallgemeinerung des Gruppenbegriffes" introduces, names and studies (connected) groupoids explicitly. The object-free definition is used, so that groupoids look very much like groups except that the product is only defined partially.
Well, first of all I have to say that it is quite amazing that the definition of a category is basically already there in Brandt's paper. Just erase the inverse elements from Axiom III. The paper doesn't really mention the arrow picture stressed by Mac Lane and Eilenberg, although the notions "einander rechts" (sharing the same codomain) and "einander links" (sharing the same domain) are introduced for groupoid elements aka morphisms.
See here for a list of further early publications on groupoids.
Nowadays, groupoids are usually seen as special categories. (Curiously, in homotopy type theory, categories are seen as special $\infty$-groupoids.) But the definition of a groupoid has appeared 20 years before the definition of a category. This leads to many (related) questions:


*

*Why did it take 20 years?

*Does the study of groupoids have influenced the development of the notion of a category?

*Did Mac Lane and Eilenberg know the work on groupoids?

*Is Brandt's work rather unknown? (Why?) Or have you heard of it before?

 A: As Yemon suggests in the Comments, perhaps you need to look at Ronnie Brown's paper:
http://groupoids.org.uk/pdffiles/groupoidsurvey.pdf
and then, I would add, to look at his book `Topology and groupoids', followed by the other sources on the page:
http://groupoids.org.uk/gpdsweb.html
A: I would like to address a mathematical, and not historical, point.
Theer is a vast difference between the theories of infinity-groupoids (which may, for example, be realized as Kan complexes) and of infinity-groupoids (which may, for example, be realized as Rezk's complete Segal spaces). The former takes just a few pages (at most a chapter) to set up, the latter a whole book. I doubt that the prior investigation of groupoids has much relevance to the development of category theory, either historically or from the point of view of what the important questions are.
A: The influence of Brandt's groupoid definition on the definition of category by Eilenberg and Mac Lane has been discussed on the category discussion list. 
Bill Cockcroft told me in 1964-70 that there was an influence; he had visited Chicago for a year some time earlier. The use of groupoids in algebra was common knowledge in the 1940s, see the 1943 book on rings by Jacobson (N Carolina), and I expect the earlier book by AA Albert (Chicago), though I have not looked at that.  
I did ask Eilenberg in 1985 about the influence of groupoids; he denied it and said that if it had they would have put it in as an example! I forgot to ask Mac Lane! 
Papers [18,19] on my publication list (pdfs available) also have an extensive bibliography on groupoids. 
Paper  [147] "Three themes in the work of Charles Ehresmann:
Local-to-global; Groupoids; Higher dimensions" gives an impression of Ehresmann's interest in geometric applications of groupoids. 
Reidemeister's 1932 book on "Topologie"  mentions the fundamental groupoid, and the groupoid determined by a group action. A recent translation to English by John Stillwell is available as    arXiv:1402.3906. 
The presentation in Galway explains my own interest in groupoids, through irritation  that the usual van Kampen theorem did not compute the fundamental group of the circle, THE basic example in topology. I managed to find a solution to that in paper [4], using nonabelian cohomology,  but the solution using  the fundamental groupoid on a set of base points in [8],   inspired by a paper of Philip Higgins, was more useful.  
A: Not an answer, but a hopefully somewhat relevant comment: The "arrow point of view stressed by Mac Lane and Eilenberg" is worth investigating more closely.  it appears that the notation of arrows for maps, exact sequences and so on only took off simultaneously with the establishment of category theory, that is to say between 1947 and 1952.  See the nice notes of Beno Eckmann on the subject of "Arrows and Exact Sequences" http://www.indiana.edu/~jfdavis/notes/eckmann.pdf
