Who owns intellectual property from research funded by an external company at a university? If a company or any external organization collaborates with a University to fund research - perhaps even open a lab - who owns the intellectual property (IP) of anything that results from that research? Is it the company, the university, or both?

Do cases like these affect IP ownership:


the university buys equipment/pays its professors and student researchers with money granted by the company 
the company uses equipment and funds available at the university to conduct research?
It should be negotiated and specified in a written contract.  Each contract could be different.