Recent progress in integrated-optics technology has made photonics a promising platform for quantum networks and quantum computation protocols. Integrated optical circuits are characterized by small device footprints and unrivalled intrinsic interferometric stability. Here, we take advantage of femtosecond-laser-written waveguides' ability to process polarization-encoded qubits and present an implementation of a heralded controlled-NOT gate on chip. We evaluate the gate performance in the computational basis and a superposition basis, showing that the gate can create polarization entanglement between two photons. Transmission through the integrated device is optimized using thermally-expanded-core fibers and adiabatically reduced mode-field diameters at the waveguide facets. This demonstration underlines the feasibility of integrated quantum gates for all-optical quantum networks and quantum repeaters.One of the most remarkable implications of quantum mechanics is the possibility of a machine that would dramatically outperform standard computers for certain tasks [1]. Research groups around the world are pursuing a variety of approaches to develop such a quantum computer. Photonics has a rich history as a platform for fundamental quantum mechanics experiments [2][3][4], and it has developed into a competitive technology for quantum computing and quantum networks as well [5][6][7]. One challenge facing the optical approach to quantum computing is that the traditional bulk-optics setups required to perform more complex experiments rapidly grow in size, and thus are challenging to stabilize. Integrated photonics offers a solution to this problem, promising intrinsic interferometric stability and the possibility of implementing a large number of quantum logic gates on a small monolithic chip. This technology has seen enormous progress in recent years [8][9][10][11], and may offer a realistic approach to realizing the complex circuits needed for scalable photonic quantum computing and quantum networks [12].An important feature of photonic qubits is their resistance to decoherence, even at room temperature. While photons' limited interaction with the environment is an important advantage over matter systems in this context, it complicates the design of the two-qubit gates crucial for universal quantum computation (any quantum logic circuit can be realized using a combination of only single-qubit and two-qubit gates [13]). However, the seminal work of Knill, Laflamme, and Milburn (KLM) showed that scalable linear optical quantum computing can be realized using only linear optical interferometers, single-photon sources, and single-photon detectors [14]. The two key concepts of the KLM scheme are (i) that the process of photon detection induces effective nonlinearites for two-photon gate operations, and (ii) that such gate operations can be achieved arXiv:1708.06778v2 [quant-ph]